ogre-python 14.2.0__cp310-cp310-macosx_12_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Ogre/Bites.py +14 -0
- Ogre/Bullet.py +14 -0
- Ogre/ImGui.py +12 -0
- Ogre/Numpy.py +59 -0
- Ogre/OGRE/Codec_Assimp.14.2.dylib +0 -0
- Ogre/OGRE/Codec_Assimp.dylib +0 -0
- Ogre/OGRE/Codec_STBI.14.2.dylib +0 -0
- Ogre/OGRE/Codec_STBI.dylib +0 -0
- Ogre/OGRE/Plugin_DotScene.14.2.dylib +0 -0
- Ogre/OGRE/Plugin_DotScene.dylib +0 -0
- Ogre/OGRE/Plugin_OctreeSceneManager.14.2.dylib +0 -0
- Ogre/OGRE/Plugin_OctreeSceneManager.dylib +0 -0
- Ogre/OGRE/Plugin_ParticleFX.14.2.dylib +0 -0
- Ogre/OGRE/Plugin_ParticleFX.dylib +0 -0
- Ogre/OGRE/RenderSystem_GL.14.2.dylib +0 -0
- Ogre/OGRE/RenderSystem_GL.dylib +0 -0
- Ogre/OGRE/RenderSystem_GL3Plus.14.2.dylib +0 -0
- Ogre/OGRE/RenderSystem_GL3Plus.dylib +0 -0
- Ogre/OGRE/RenderSystem_Tiny.14.2.dylib +0 -0
- Ogre/OGRE/RenderSystem_Tiny.dylib +0 -0
- Ogre/Ogre.py +12 -0
- Ogre/Overlay.py +14 -0
- Ogre/RTShader.py +14 -0
- Ogre/Terrain.py +14 -0
- Ogre/_Bites.so +0 -0
- Ogre/_Bullet.so +0 -0
- Ogre/_ImGui.so +0 -0
- Ogre/_Ogre.so +0 -0
- Ogre/_Overlay.so +0 -0
- Ogre/_RTShader.so +0 -0
- Ogre/_Terrain.so +0 -0
- Ogre/__init__.py +2 -0
- Ogre/libOgreBites.14.2.dylib +0 -0
- Ogre/libOgreBites.dylib +0 -0
- Ogre/libOgreBullet.dylib +0 -0
- Ogre/libOgreMain.14.2.dylib +0 -0
- Ogre/libOgreMain.dylib +0 -0
- Ogre/libOgreOverlay.14.2.dylib +0 -0
- Ogre/libOgreOverlay.dylib +0 -0
- Ogre/libOgrePaging.14.2.dylib +0 -0
- Ogre/libOgrePaging.dylib +0 -0
- Ogre/libOgreRTShaderSystem.14.2.dylib +0 -0
- Ogre/libOgreRTShaderSystem.dylib +0 -0
- Ogre/libOgreTerrain.14.2.dylib +0 -0
- Ogre/libOgreTerrain.dylib +0 -0
- Ogre/libSDL2-2.0.0.dylib +0 -0
- Ogre/libSDL2-2.0.dylib +0 -0
- Ogre/libSDL2.dylib +0 -0
- Ogre/libz.1.3.1.dylib +0 -0
- Ogre/libz.1.dylib +0 -0
- Ogre/libz.dylib +0 -0
- ogre_python-14.2.0.data/data/Media/Main/DefaultShaders.metal +38 -0
- ogre_python-14.2.0.data/data/Media/Main/GLSL_GL3Support.glsl +97 -0
- ogre_python-14.2.0.data/data/Media/Main/HLSL_SM4Support.hlsl +98 -0
- ogre_python-14.2.0.data/data/Media/Main/OgreUnifiedShader.h +183 -0
- ogre_python-14.2.0.data/data/Media/Main/Shadow.material +85 -0
- ogre_python-14.2.0.data/data/Media/Main/ShadowBlend.frag +11 -0
- ogre_python-14.2.0.data/data/Media/Main/ShadowBlend.vert +12 -0
- ogre_python-14.2.0.data/data/Media/Main/ShadowExtrudeDirLight.vert +18 -0
- ogre_python-14.2.0.data/data/Media/Main/ShadowExtrudeDirLightFinite.vert +22 -0
- ogre_python-14.2.0.data/data/Media/Main/ShadowExtrudePointLight.vert +19 -0
- ogre_python-14.2.0.data/data/Media/Main/ShadowExtrudePointLightFinite.vert +22 -0
- ogre_python-14.2.0.data/data/Media/Main/ShadowVolumeExtude.program +41 -0
- ogre_python-14.2.0.data/data/Media/Main/spot_shadow_fade.dds +0 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/FFPLib_AlphaTest.glsl +45 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/FFPLib_Fog.glsl +92 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/FFPLib_Texturing.glsl +144 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/FFPLib_Transform.glsl +100 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/RTSLib_IBL.glsl +88 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/RTSLib_LTC.glsl +114 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/RTSLib_Lighting.glsl +18 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/RTSSamplers.material +17 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/SGXLib_CookTorrance.glsl +246 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/SGXLib_DualQuaternion.glsl +172 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/SGXLib_IntegratedPSSM.glsl +183 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/SGXLib_LayeredBlending.glsl +825 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/SGXLib_NormalMap.glsl +125 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/SGXLib_PerPixelLighting.glsl +172 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/SGXLib_TriplanarTexturing.glsl +47 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/SGXLib_WBOIT.glsl +19 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/dfgLUTmultiscatter.dds +0 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/ltc_1.dds +0 -0
- ogre_python-14.2.0.data/data/Media/RTShaderLib/ltc_2.dds +0 -0
- ogre_python-14.2.0.data/data/Media/Terrain/TerrainSurface.glsl +83 -0
- ogre_python-14.2.0.data/data/Media/Terrain/TerrainTransforms.glsl +36 -0
- ogre_python-14.2.0.data/data/Media/packs/SdkTrays.zip +0 -0
- ogre_python-14.2.0.data/data/Media/packs/profiler.zip +0 -0
- ogre_python-14.2.0.data/data/bin/plugins.cfg +27 -0
- ogre_python-14.2.0.data/data/bin/resources.cfg +12 -0
- ogre_python-14.2.0.data/data/bin/sdl2-config +65 -0
- ogre_python-14.2.0.dist-info/AUTHORS +312 -0
- ogre_python-14.2.0.dist-info/LICENSE +21 -0
- ogre_python-14.2.0.dist-info/METADATA +125 -0
- ogre_python-14.2.0.dist-info/RECORD +96 -0
- ogre_python-14.2.0.dist-info/WHEEL +5 -0
- ogre_python-14.2.0.dist-info/top_level.txt +1 -0
Ogre/Bites.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# This file was automatically generated by SWIG (https://www.swig.org).
|
|
2
|
+
# Version 4.2.0
|
|
3
|
+
#
|
|
4
|
+
# Do not make changes to this file unless you know what you are doing - modify
|
|
5
|
+
# the SWIG interface file instead.
|
|
6
|
+
|
|
7
|
+
from sys import version_info as _swig_python_version_info
|
|
8
|
+
import Ogre.Ogre
|
|
9
|
+
|
|
10
|
+
# Pull in all the attributes from the low-level C/C++ module
|
|
11
|
+
if __package__ or "." in __name__:
|
|
12
|
+
from ._Bites import *
|
|
13
|
+
else:
|
|
14
|
+
from _Bites import *
|
Ogre/Bullet.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# This file was automatically generated by SWIG (https://www.swig.org).
|
|
2
|
+
# Version 4.2.0
|
|
3
|
+
#
|
|
4
|
+
# Do not make changes to this file unless you know what you are doing - modify
|
|
5
|
+
# the SWIG interface file instead.
|
|
6
|
+
|
|
7
|
+
from sys import version_info as _swig_python_version_info
|
|
8
|
+
import Ogre.Ogre
|
|
9
|
+
|
|
10
|
+
# Pull in all the attributes from the low-level C/C++ module
|
|
11
|
+
if __package__ or "." in __name__:
|
|
12
|
+
from ._Bullet import *
|
|
13
|
+
else:
|
|
14
|
+
from _Bullet import *
|
Ogre/ImGui.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# This file was automatically generated by SWIG (https://www.swig.org).
|
|
2
|
+
# Version 4.2.0
|
|
3
|
+
#
|
|
4
|
+
# Do not make changes to this file unless you know what you are doing - modify
|
|
5
|
+
# the SWIG interface file instead.
|
|
6
|
+
|
|
7
|
+
from sys import version_info as _swig_python_version_info
|
|
8
|
+
# Pull in all the attributes from the low-level C/C++ module
|
|
9
|
+
if __package__ or "." in __name__:
|
|
10
|
+
from ._ImGui import *
|
|
11
|
+
else:
|
|
12
|
+
from _ImGui import *
|
Ogre/Numpy.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import Ogre
|
|
2
|
+
|
|
3
|
+
import ctypes
|
|
4
|
+
import numpy.ctypeslib as npc
|
|
5
|
+
import numpy as np
|
|
6
|
+
|
|
7
|
+
def AsDataStream(arr):
|
|
8
|
+
"""
|
|
9
|
+
copy numpy array to Ogre.MemoryDataStream that can be used in Ogre
|
|
10
|
+
@param arr: some numpy array
|
|
11
|
+
"""
|
|
12
|
+
size = int(np.prod(arr.shape) * arr.dtype.itemsize)
|
|
13
|
+
ret = Ogre.MemoryDataStream(size)
|
|
14
|
+
tp = ctypes.POINTER(ctypes.c_ubyte)
|
|
15
|
+
np_view = npc.as_array(ctypes.cast(int(ret.getPtr()), tp), (size, ))
|
|
16
|
+
np_view[:] = arr.ravel().view(np.ubyte)
|
|
17
|
+
|
|
18
|
+
return ret
|
|
19
|
+
|
|
20
|
+
def view(o):
|
|
21
|
+
"""
|
|
22
|
+
writable numpy view to the ogre data types
|
|
23
|
+
|
|
24
|
+
take care that the ogre type does not get released while the view is used.
|
|
25
|
+
e.g. this is invalid
|
|
26
|
+
|
|
27
|
+
v = Ogre.Vector3()
|
|
28
|
+
return OgreNumpy.view(v)
|
|
29
|
+
|
|
30
|
+
instead do
|
|
31
|
+
return OgreNumpy.view(v).copy()
|
|
32
|
+
|
|
33
|
+
to pass numpy arrays into Ogre use AsDataStream()
|
|
34
|
+
"""
|
|
35
|
+
tp = ctypes.POINTER(ctypes.c_float)
|
|
36
|
+
|
|
37
|
+
if isinstance(o, Ogre.Vector2):
|
|
38
|
+
shape = (2,)
|
|
39
|
+
ptr = o.this
|
|
40
|
+
elif isinstance(o, Ogre.Vector3):
|
|
41
|
+
shape = (3,)
|
|
42
|
+
ptr = o.this
|
|
43
|
+
elif isinstance(o, Ogre.Vector4):
|
|
44
|
+
shape = (4,)
|
|
45
|
+
ptr = o.this
|
|
46
|
+
elif isinstance(o, Ogre.Matrix3):
|
|
47
|
+
shape = (3, 3)
|
|
48
|
+
ptr = o.this
|
|
49
|
+
elif isinstance(o, Ogre.Matrix4):
|
|
50
|
+
shape = (4, 4)
|
|
51
|
+
ptr = o.this
|
|
52
|
+
elif isinstance(o, Ogre.PixelBox):
|
|
53
|
+
tp = ctypes.POINTER(ctypes.c_uint8)
|
|
54
|
+
shape = (o.getHeight(), o.getWidth(), Ogre.PixelUtil.getNumElemBytes(o.format))
|
|
55
|
+
ptr = o.data
|
|
56
|
+
else:
|
|
57
|
+
raise TypeError("do not know how to map '{}'".format(type(o).__name__))
|
|
58
|
+
|
|
59
|
+
return npc.as_array(ctypes.cast(int(ptr), tp), shape)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
Ogre/Ogre.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# This file was automatically generated by SWIG (https://www.swig.org).
|
|
2
|
+
# Version 4.2.0
|
|
3
|
+
#
|
|
4
|
+
# Do not make changes to this file unless you know what you are doing - modify
|
|
5
|
+
# the SWIG interface file instead.
|
|
6
|
+
|
|
7
|
+
from sys import version_info as _swig_python_version_info
|
|
8
|
+
# Pull in all the attributes from the low-level C/C++ module
|
|
9
|
+
if __package__ or "." in __name__:
|
|
10
|
+
from ._Ogre import *
|
|
11
|
+
else:
|
|
12
|
+
from _Ogre import *
|
Ogre/Overlay.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# This file was automatically generated by SWIG (https://www.swig.org).
|
|
2
|
+
# Version 4.2.0
|
|
3
|
+
#
|
|
4
|
+
# Do not make changes to this file unless you know what you are doing - modify
|
|
5
|
+
# the SWIG interface file instead.
|
|
6
|
+
|
|
7
|
+
from sys import version_info as _swig_python_version_info
|
|
8
|
+
import Ogre.Ogre
|
|
9
|
+
|
|
10
|
+
# Pull in all the attributes from the low-level C/C++ module
|
|
11
|
+
if __package__ or "." in __name__:
|
|
12
|
+
from ._Overlay import *
|
|
13
|
+
else:
|
|
14
|
+
from _Overlay import *
|
Ogre/RTShader.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# This file was automatically generated by SWIG (https://www.swig.org).
|
|
2
|
+
# Version 4.2.0
|
|
3
|
+
#
|
|
4
|
+
# Do not make changes to this file unless you know what you are doing - modify
|
|
5
|
+
# the SWIG interface file instead.
|
|
6
|
+
|
|
7
|
+
from sys import version_info as _swig_python_version_info
|
|
8
|
+
import Ogre.Ogre
|
|
9
|
+
|
|
10
|
+
# Pull in all the attributes from the low-level C/C++ module
|
|
11
|
+
if __package__ or "." in __name__:
|
|
12
|
+
from ._RTShader import *
|
|
13
|
+
else:
|
|
14
|
+
from _RTShader import *
|
Ogre/Terrain.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# This file was automatically generated by SWIG (https://www.swig.org).
|
|
2
|
+
# Version 4.2.0
|
|
3
|
+
#
|
|
4
|
+
# Do not make changes to this file unless you know what you are doing - modify
|
|
5
|
+
# the SWIG interface file instead.
|
|
6
|
+
|
|
7
|
+
from sys import version_info as _swig_python_version_info
|
|
8
|
+
import Ogre.Ogre
|
|
9
|
+
|
|
10
|
+
# Pull in all the attributes from the low-level C/C++ module
|
|
11
|
+
if __package__ or "." in __name__:
|
|
12
|
+
from ._Terrain import *
|
|
13
|
+
else:
|
|
14
|
+
from _Terrain import *
|
Ogre/_Bites.so
ADDED
|
Binary file
|
Ogre/_Bullet.so
ADDED
|
Binary file
|
Ogre/_ImGui.so
ADDED
|
Binary file
|
Ogre/_Ogre.so
ADDED
|
Binary file
|
Ogre/_Overlay.so
ADDED
|
Binary file
|
Ogre/_RTShader.so
ADDED
|
Binary file
|
Ogre/_Terrain.so
ADDED
|
Binary file
|
Ogre/__init__.py
ADDED
|
Binary file
|
Ogre/libOgreBites.dylib
ADDED
|
Binary file
|
Ogre/libOgreBullet.dylib
ADDED
|
Binary file
|
|
Binary file
|
Ogre/libOgreMain.dylib
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
Ogre/libOgrePaging.dylib
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
Ogre/libSDL2-2.0.0.dylib
ADDED
|
Binary file
|
Ogre/libSDL2-2.0.dylib
ADDED
|
Binary file
|
Ogre/libSDL2.dylib
ADDED
|
Binary file
|
Ogre/libz.1.3.1.dylib
ADDED
|
Binary file
|
Ogre/libz.1.dylib
ADDED
|
Binary file
|
Ogre/libz.dylib
ADDED
|
Binary file
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#include "OgreUnifiedShader.h"
|
|
2
|
+
|
|
3
|
+
struct RasterizerData
|
|
4
|
+
{
|
|
5
|
+
vec4 pos [[position]];
|
|
6
|
+
vec2 uv;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
struct Vertex
|
|
10
|
+
{
|
|
11
|
+
IN(vec3 pos, POSITION);
|
|
12
|
+
IN(vec2 uv, TEXCOORD0);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
struct Uniform
|
|
16
|
+
{
|
|
17
|
+
mat4 mvpMtx;
|
|
18
|
+
mat4 texMtx;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// first 15 slots are reserved for the vertex attributes
|
|
22
|
+
#define UNIFORM_INDEX_START 16
|
|
23
|
+
|
|
24
|
+
vertex RasterizerData default_vp(Vertex in [[stage_in]],
|
|
25
|
+
constant Uniform& u [[buffer(UNIFORM_INDEX_START)]])
|
|
26
|
+
{
|
|
27
|
+
RasterizerData out;
|
|
28
|
+
out.pos = u.mvpMtx * vec4(in.pos, 1);
|
|
29
|
+
out.uv = (u.texMtx * vec4(in.uv,1,1)).xy;
|
|
30
|
+
return out;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
fragment half4 default_fp(RasterizerData in [[stage_in]],
|
|
34
|
+
metal::texture2d<half> tex [[texture(0)]],
|
|
35
|
+
metal::sampler s [[sampler(0)]])
|
|
36
|
+
{
|
|
37
|
+
return tex.sample(s, in.uv);
|
|
38
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// This file is part of the OGRE project.
|
|
2
|
+
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
|
3
|
+
// of this distribution and at https://www.ogre3d.org/licensing.
|
|
4
|
+
|
|
5
|
+
// @public-api
|
|
6
|
+
|
|
7
|
+
#if defined(OGRE_FRAGMENT_SHADER) && defined(OGRE_GLSLES)
|
|
8
|
+
// define default precisions for ES fragement shaders
|
|
9
|
+
precision mediump float;
|
|
10
|
+
|
|
11
|
+
#if __VERSION__ > 100
|
|
12
|
+
precision lowp sampler2DArray;
|
|
13
|
+
precision lowp sampler2DShadow;
|
|
14
|
+
precision lowp sampler3D;
|
|
15
|
+
#endif
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
#if __VERSION__ == 100
|
|
19
|
+
mat2 transpose(mat2 m)
|
|
20
|
+
{
|
|
21
|
+
return mat2(m[0][0], m[1][0],
|
|
22
|
+
m[0][1], m[1][1]);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
mat3 transpose(mat3 m)
|
|
26
|
+
{
|
|
27
|
+
return mat3(m[0][0], m[1][0], m[2][0],
|
|
28
|
+
m[0][1], m[1][1], m[2][1],
|
|
29
|
+
m[0][2], m[1][2], m[2][2]);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
mat4 transpose(mat4 m)
|
|
33
|
+
{
|
|
34
|
+
return mat4(m[0][0], m[1][0], m[2][0], m[3][0],
|
|
35
|
+
m[0][1], m[1][1], m[2][1], m[3][1],
|
|
36
|
+
m[0][2], m[1][2], m[2][2], m[3][2],
|
|
37
|
+
m[0][3], m[1][3], m[2][3], m[3][3]);
|
|
38
|
+
}
|
|
39
|
+
#endif
|
|
40
|
+
|
|
41
|
+
#if __VERSION__ > 120 || defined(OGRE_GLSLANG)
|
|
42
|
+
#define texture1D texture
|
|
43
|
+
#define texture2D texture
|
|
44
|
+
#define texture3D texture
|
|
45
|
+
#define texture2DArray texture
|
|
46
|
+
#define textureCube texture
|
|
47
|
+
#define shadow2D texture
|
|
48
|
+
#define shadow2DProj textureProj
|
|
49
|
+
#define texture2DProj textureProj
|
|
50
|
+
#define texture2DLod textureLod
|
|
51
|
+
#define textureCubeLod textureLod
|
|
52
|
+
|
|
53
|
+
#if defined(OGRE_GLSLANG) || (__VERSION__ > 150 && defined(OGRE_VERTEX_SHADER)) || __VERSION__ >= 410
|
|
54
|
+
#define IN(decl, loc) layout(location = loc) in decl;
|
|
55
|
+
#else
|
|
56
|
+
#define IN(decl, loc) in decl;
|
|
57
|
+
#endif
|
|
58
|
+
|
|
59
|
+
#if defined(OGRE_GLSLANG) || (__VERSION__ > 150 && defined(OGRE_FRAGMENT_SHADER)) || __VERSION__ >= 410
|
|
60
|
+
#define OUT(decl, loc) layout(location = loc) out decl;
|
|
61
|
+
#else
|
|
62
|
+
#define OUT(decl, loc) out decl;
|
|
63
|
+
#endif
|
|
64
|
+
|
|
65
|
+
#else
|
|
66
|
+
|
|
67
|
+
#ifdef OGRE_VERTEX_SHADER
|
|
68
|
+
#define IN(decl, loc) attribute decl;
|
|
69
|
+
#define OUT(decl, loc) varying decl;
|
|
70
|
+
#else
|
|
71
|
+
#define IN(decl, loc) varying decl;
|
|
72
|
+
#define OUT(decl, loc) out decl;
|
|
73
|
+
#endif
|
|
74
|
+
|
|
75
|
+
#endif
|
|
76
|
+
|
|
77
|
+
#if defined(OGRE_FRAGMENT_SHADER) && (defined(OGRE_GLSLANG) || (__VERSION__ > 130))
|
|
78
|
+
#define gl_FragColor FragColor
|
|
79
|
+
OUT(vec4 FragColor, 0)
|
|
80
|
+
#endif
|
|
81
|
+
|
|
82
|
+
#ifdef VULKAN
|
|
83
|
+
|
|
84
|
+
#ifdef OGRE_VERTEX_SHADER
|
|
85
|
+
#define OGRE_UNIFORMS_BEGIN layout(binding = 0, row_major) uniform OgreUniforms {
|
|
86
|
+
#else
|
|
87
|
+
#define OGRE_UNIFORMS_BEGIN layout(binding = 1, row_major) uniform OgreUniforms {
|
|
88
|
+
#endif
|
|
89
|
+
|
|
90
|
+
#define OGRE_UNIFORMS_END };
|
|
91
|
+
|
|
92
|
+
#else
|
|
93
|
+
|
|
94
|
+
#define OGRE_UNIFORMS_BEGIN
|
|
95
|
+
#define OGRE_UNIFORMS_END
|
|
96
|
+
|
|
97
|
+
#endif
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// This file is part of the OGRE project.
|
|
2
|
+
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
|
3
|
+
// of this distribution and at https://www.ogre3d.org/licensing.
|
|
4
|
+
|
|
5
|
+
// @public-api
|
|
6
|
+
|
|
7
|
+
#if OGRE_HLSL >= 4
|
|
8
|
+
|
|
9
|
+
// SM4 separates sampler into Texture and SamplerState
|
|
10
|
+
|
|
11
|
+
#define sampler1D Sampler1D
|
|
12
|
+
#define sampler2D Sampler2D
|
|
13
|
+
#define sampler3D Sampler3D
|
|
14
|
+
#define samplerCUBE SamplerCube
|
|
15
|
+
|
|
16
|
+
struct Sampler1D
|
|
17
|
+
{
|
|
18
|
+
Texture1D t;
|
|
19
|
+
SamplerState s;
|
|
20
|
+
};
|
|
21
|
+
struct Sampler2D
|
|
22
|
+
{
|
|
23
|
+
Texture2D t;
|
|
24
|
+
SamplerState s;
|
|
25
|
+
};
|
|
26
|
+
struct Sampler3D
|
|
27
|
+
{
|
|
28
|
+
Texture3D t;
|
|
29
|
+
SamplerState s;
|
|
30
|
+
};
|
|
31
|
+
struct SamplerCube
|
|
32
|
+
{
|
|
33
|
+
TextureCube t;
|
|
34
|
+
SamplerState s;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
float4 tex1D(Sampler1D s, float v) { return s.t.Sample(s.s, v); }
|
|
38
|
+
float4 tex2D(Sampler2D s, float2 v) { return s.t.Sample(s.s, v); }
|
|
39
|
+
float4 tex3D(Sampler3D s, float3 v) { return s.t.Sample(s.s, v); }
|
|
40
|
+
float4 texCUBE(SamplerCube s, float3 v) { return s.t.Sample(s.s, v); }
|
|
41
|
+
float4 texCUBElod(SamplerCube s, float4 v) { return s.t.SampleLevel(s.s, v.xyz, v.w); }
|
|
42
|
+
|
|
43
|
+
float4 tex2D(Sampler2D s, float2 v, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, v, ddx, ddy); }
|
|
44
|
+
float4 tex2Dproj(Sampler2D s, float4 v) { return s.t.Sample(s.s, v.xy/v.w); }
|
|
45
|
+
float4 tex2Dlod(Sampler2D s, float4 v) { return s.t.SampleLevel(s.s, v.xy, v.w); }
|
|
46
|
+
|
|
47
|
+
#define SAMPLER1D(name, reg) \
|
|
48
|
+
Texture1D name ## Tex : register(t ## reg);\
|
|
49
|
+
SamplerState name ## State : register(s ## reg);\
|
|
50
|
+
static Sampler1D name = {name ## Tex, name ## State}
|
|
51
|
+
|
|
52
|
+
#define SAMPLER2D(name, reg) \
|
|
53
|
+
Texture2D name ## Tex : register(t ## reg);\
|
|
54
|
+
SamplerState name ## State : register(s ## reg);\
|
|
55
|
+
static Sampler2D name = {name ## Tex, name ## State}
|
|
56
|
+
|
|
57
|
+
#define SAMPLER3D(name, reg) \
|
|
58
|
+
Texture3D name ## Tex : register(t ## reg);\
|
|
59
|
+
SamplerState name ## State : register(s ## reg);\
|
|
60
|
+
static Sampler3D name = {name ## Tex, name ## State}
|
|
61
|
+
|
|
62
|
+
#define SAMPLERCUBE(name, reg) \
|
|
63
|
+
TextureCube name ## Tex : register(t ## reg);\
|
|
64
|
+
SamplerState name ## State : register(s ## reg);\
|
|
65
|
+
static SamplerCube name = {name ## Tex, name ## State}
|
|
66
|
+
|
|
67
|
+
// the following are not available in D3D9, but provided for convenience
|
|
68
|
+
struct Sampler2DShadow
|
|
69
|
+
{
|
|
70
|
+
Texture2D t;
|
|
71
|
+
SamplerComparisonState s;
|
|
72
|
+
};
|
|
73
|
+
struct Sampler2DArray
|
|
74
|
+
{
|
|
75
|
+
Texture2DArray t;
|
|
76
|
+
SamplerState s;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
#define SAMPLER2DSHADOW(name, reg) \
|
|
80
|
+
Texture2D name ## Tex : register(t ## reg);\
|
|
81
|
+
SamplerComparisonState name ## State : register(s ## reg);\
|
|
82
|
+
static Sampler2DShadow name = {name ## Tex, name ## State}
|
|
83
|
+
|
|
84
|
+
#define SAMPLER2DARRAY(name, reg) \
|
|
85
|
+
Texture2DArray name ## Tex : register(t ## reg);\
|
|
86
|
+
SamplerState name ## State : register(s ## reg);\
|
|
87
|
+
static Sampler2DArray name = {name ## Tex, name ## State}
|
|
88
|
+
|
|
89
|
+
float tex2Dcmp(Sampler2DShadow s, float3 v) { return s.t.SampleCmpLevelZero(s.s, v.xy, v.z); }
|
|
90
|
+
float4 tex2DARRAY(Sampler2DArray s, float3 v) { return s.t.Sample(s.s, v); }
|
|
91
|
+
#else
|
|
92
|
+
|
|
93
|
+
#define SAMPLER1D(name, reg) sampler1D name : register(s ## reg)
|
|
94
|
+
#define SAMPLER2D(name, reg) sampler2D name : register(s ## reg)
|
|
95
|
+
#define SAMPLER3D(name, reg) sampler3D name : register(s ## reg)
|
|
96
|
+
#define SAMPLERCUBE(name, reg) samplerCUBE name : register(s ## reg)
|
|
97
|
+
|
|
98
|
+
#endif
|