ogre-python 13.6.4__cp310-cp310-macosx_11_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.
Files changed (91) hide show
  1. Ogre/Bites.py +14 -0
  2. Ogre/Bullet.py +14 -0
  3. Ogre/ImGui.py +12 -0
  4. Ogre/Numpy.py +59 -0
  5. Ogre/OGRE/Codec_Assimp.13.6.dylib +0 -0
  6. Ogre/OGRE/Codec_Assimp.dylib +0 -0
  7. Ogre/OGRE/Codec_STBI.13.6.dylib +0 -0
  8. Ogre/OGRE/Codec_STBI.dylib +0 -0
  9. Ogre/OGRE/Plugin_DotScene.13.6.dylib +0 -0
  10. Ogre/OGRE/Plugin_DotScene.dylib +0 -0
  11. Ogre/OGRE/Plugin_OctreeSceneManager.13.6.dylib +0 -0
  12. Ogre/OGRE/Plugin_OctreeSceneManager.dylib +0 -0
  13. Ogre/OGRE/Plugin_ParticleFX.13.6.dylib +0 -0
  14. Ogre/OGRE/Plugin_ParticleFX.dylib +0 -0
  15. Ogre/OGRE/RenderSystem_GL.13.6.dylib +0 -0
  16. Ogre/OGRE/RenderSystem_GL.dylib +0 -0
  17. Ogre/OGRE/RenderSystem_GL3Plus.13.6.dylib +0 -0
  18. Ogre/OGRE/RenderSystem_GL3Plus.dylib +0 -0
  19. Ogre/OGRE/RenderSystem_Tiny.13.6.dylib +0 -0
  20. Ogre/OGRE/RenderSystem_Tiny.dylib +0 -0
  21. Ogre/Ogre.py +12 -0
  22. Ogre/Overlay.py +14 -0
  23. Ogre/RTShader.py +14 -0
  24. Ogre/Terrain.py +14 -0
  25. Ogre/_Bites.so +0 -0
  26. Ogre/_Bullet.so +0 -0
  27. Ogre/_ImGui.so +0 -0
  28. Ogre/_Ogre.so +0 -0
  29. Ogre/_Overlay.so +0 -0
  30. Ogre/_RTShader.so +0 -0
  31. Ogre/_Terrain.so +0 -0
  32. Ogre/__init__.py +2 -0
  33. Ogre/libOgreBites.13.6.dylib +0 -0
  34. Ogre/libOgreBites.dylib +0 -0
  35. Ogre/libOgreBullet.dylib +0 -0
  36. Ogre/libOgreMain.13.6.dylib +0 -0
  37. Ogre/libOgreMain.dylib +0 -0
  38. Ogre/libOgreOverlay.13.6.dylib +0 -0
  39. Ogre/libOgreOverlay.dylib +0 -0
  40. Ogre/libOgrePaging.13.6.dylib +0 -0
  41. Ogre/libOgrePaging.dylib +0 -0
  42. Ogre/libOgreRTShaderSystem.13.6.dylib +0 -0
  43. Ogre/libOgreRTShaderSystem.dylib +0 -0
  44. Ogre/libOgreTerrain.13.6.dylib +0 -0
  45. Ogre/libOgreTerrain.dylib +0 -0
  46. Ogre/libSDL2-2.0.dylib +0 -0
  47. Ogre/libSDL2.dylib +0 -0
  48. Ogre/libz.1.2.13.dylib +0 -0
  49. Ogre/libz.1.dylib +0 -0
  50. Ogre/libz.dylib +0 -0
  51. ogre_python-13.6.4.data/data/Media/Main/DefaultShaders.metal +38 -0
  52. ogre_python-13.6.4.data/data/Media/Main/GLSL_GL3Support.glsl +86 -0
  53. ogre_python-13.6.4.data/data/Media/Main/HLSL_SM4Support.hlsl +98 -0
  54. ogre_python-13.6.4.data/data/Media/Main/OgreUnifiedShader.h +184 -0
  55. ogre_python-13.6.4.data/data/Media/Main/Shadow.material +85 -0
  56. ogre_python-13.6.4.data/data/Media/Main/ShadowBlend.frag +11 -0
  57. ogre_python-13.6.4.data/data/Media/Main/ShadowBlend.vert +12 -0
  58. ogre_python-13.6.4.data/data/Media/Main/ShadowExtrudeDirLight.vert +18 -0
  59. ogre_python-13.6.4.data/data/Media/Main/ShadowExtrudeDirLightFinite.vert +22 -0
  60. ogre_python-13.6.4.data/data/Media/Main/ShadowExtrudePointLight.vert +19 -0
  61. ogre_python-13.6.4.data/data/Media/Main/ShadowExtrudePointLightFinite.vert +22 -0
  62. ogre_python-13.6.4.data/data/Media/Main/ShadowVolumeExtude.program +41 -0
  63. ogre_python-13.6.4.data/data/Media/Main/spot_shadow_fade.dds +0 -0
  64. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/FFPLib_AlphaTest.glsl +45 -0
  65. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/FFPLib_Common.glsl +1 -0
  66. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/FFPLib_Fog.glsl +134 -0
  67. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/FFPLib_Texturing.glsl +144 -0
  68. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/FFPLib_Transform.glsl +117 -0
  69. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/RTSLib_IBL.glsl +88 -0
  70. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/SGXLib_CookTorrance.glsl +241 -0
  71. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/SGXLib_DualQuaternion.glsl +172 -0
  72. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/SGXLib_IntegratedPSSM.glsl +182 -0
  73. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/SGXLib_LayeredBlending.glsl +825 -0
  74. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/SGXLib_NormalMap.glsl +68 -0
  75. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/SGXLib_PerPixelLighting.glsl +236 -0
  76. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/SGXLib_TriplanarTexturing.glsl +47 -0
  77. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/SGXLib_WBOIT.glsl +19 -0
  78. ogre_python-13.6.4.data/data/Media/RTShaderLib/GLSL/dfgLUTmultiscatter.dds +0 -0
  79. ogre_python-13.6.4.data/data/Media/Terrain/TerrainSurface.glsl +62 -0
  80. ogre_python-13.6.4.data/data/Media/Terrain/TerrainTransforms.glsl +36 -0
  81. ogre_python-13.6.4.data/data/Media/packs/SdkTrays.zip +0 -0
  82. ogre_python-13.6.4.data/data/Media/packs/profiler.zip +0 -0
  83. ogre_python-13.6.4.data/data/bin/plugins.cfg +27 -0
  84. ogre_python-13.6.4.data/data/bin/resources.cfg +12 -0
  85. ogre_python-13.6.4.data/data/bin/sdl2-config +65 -0
  86. ogre_python-13.6.4.dist-info/AUTHORS +312 -0
  87. ogre_python-13.6.4.dist-info/LICENSE +21 -0
  88. ogre_python-13.6.4.dist-info/METADATA +124 -0
  89. ogre_python-13.6.4.dist-info/RECORD +91 -0
  90. ogre_python-13.6.4.dist-info/WHEEL +5 -0
  91. ogre_python-13.6.4.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.1.1
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.1.1
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.1.1
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
Ogre/Ogre.py ADDED
@@ -0,0 +1,12 @@
1
+ # This file was automatically generated by SWIG (https://www.swig.org).
2
+ # Version 4.1.1
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.1.1
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.1.1
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.1.1
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
@@ -0,0 +1,2 @@
1
+ from Ogre.Ogre import *
2
+ from Ogre.Ogre import __version__
Binary file
Binary file
Binary file
Binary file
Ogre/libOgreMain.dylib ADDED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Ogre/libSDL2-2.0.dylib ADDED
Binary file
Ogre/libSDL2.dylib ADDED
Binary file
Ogre/libz.1.2.13.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,86 @@
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 __VERSION__ == 100
8
+ mat2 transpose(mat2 m)
9
+ {
10
+ return mat2(m[0][0], m[1][0],
11
+ m[0][1], m[1][1]);
12
+ }
13
+
14
+ mat3 transpose(mat3 m)
15
+ {
16
+ return mat3(m[0][0], m[1][0], m[2][0],
17
+ m[0][1], m[1][1], m[2][1],
18
+ m[0][2], m[1][2], m[2][2]);
19
+ }
20
+
21
+ mat4 transpose(mat4 m)
22
+ {
23
+ return mat4(m[0][0], m[1][0], m[2][0], m[3][0],
24
+ m[0][1], m[1][1], m[2][1], m[3][1],
25
+ m[0][2], m[1][2], m[2][2], m[3][2],
26
+ m[0][3], m[1][3], m[2][3], m[3][3]);
27
+ }
28
+ #endif
29
+
30
+ #if __VERSION__ > 120 || defined(OGRE_GLSLANG)
31
+ #define texture1D texture
32
+ #define texture2D texture
33
+ #define texture3D texture
34
+ #define texture2DArray texture
35
+ #define textureCube texture
36
+ #define shadow2D texture
37
+ #define shadow2DProj textureProj
38
+ #define texture2DProj textureProj
39
+ #define texture2DLod textureLod
40
+ #define textureCubeLod textureLod
41
+
42
+ #if defined(OGRE_GLSLANG) || (__VERSION__ > 150 && defined(OGRE_VERTEX_SHADER)) || __VERSION__ >= 410
43
+ #define IN(decl, loc) layout(location = loc) in decl;
44
+ #else
45
+ #define IN(decl, loc) in decl;
46
+ #endif
47
+
48
+ #if defined(OGRE_GLSLANG) || (__VERSION__ > 150 && defined(OGRE_FRAGMENT_SHADER)) || __VERSION__ >= 410
49
+ #define OUT(decl, loc) layout(location = loc) out decl;
50
+ #else
51
+ #define OUT(decl, loc) out decl;
52
+ #endif
53
+
54
+ #else
55
+
56
+ #ifdef OGRE_VERTEX_SHADER
57
+ #define IN(decl, loc) attribute decl;
58
+ #define OUT(decl, loc) varying decl;
59
+ #else
60
+ #define IN(decl, loc) varying decl;
61
+ #define OUT(decl, loc) out decl;
62
+ #endif
63
+
64
+ #endif
65
+
66
+ #if defined(OGRE_FRAGMENT_SHADER) && (defined(OGRE_GLSLANG) || (__VERSION__ > 130))
67
+ #define gl_FragColor FragColor
68
+ OUT(vec4 FragColor, 0)
69
+ #endif
70
+
71
+ #ifdef VULKAN
72
+
73
+ #ifdef OGRE_VERTEX_SHADER
74
+ #define OGRE_UNIFORMS_BEGIN layout(binding = 0, row_major) uniform OgreUniforms {
75
+ #else
76
+ #define OGRE_UNIFORMS_BEGIN layout(binding = 1, row_major) uniform OgreUniforms {
77
+ #endif
78
+
79
+ #define OGRE_UNIFORMS_END };
80
+
81
+ #else
82
+
83
+ #define OGRE_UNIFORMS_BEGIN
84
+ #define OGRE_UNIFORMS_END
85
+
86
+ #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
@@ -0,0 +1,184 @@
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
+ // greatly inspired by
6
+ // - shiny: https://ogrecave.github.io/shiny/defining-materials-shaders.html
7
+ // - bgfx: https://github.com/bkaradzic/bgfx/blob/master/src/bgfx_shader.sh
8
+
9
+ /// general usage:
10
+ // MAIN_PARAMETERS
11
+ // IN(vec4 vertex, POSITION)
12
+ // MAIN_DECLARATION
13
+ // {
14
+ // GLSL code here
15
+ // }
16
+
17
+ /// configuration
18
+ // use macros that will be default with Ogre 14
19
+ // #define USE_OGRE_FROM_FUTURE
20
+
21
+ // @public-api
22
+
23
+ #if defined(OGRE_HLSL) || defined(OGRE_CG)
24
+ // HLSL
25
+ #include "HLSL_SM4Support.hlsl"
26
+ #define vec2 float2
27
+ #define vec3 float3
28
+ #define vec4 float4
29
+ #define mat3 float3x3
30
+ #define mat4 float4x4
31
+
32
+ #define ivec2 int2
33
+ #define ivec3 int3
34
+ #define ivec4 int4
35
+
36
+ #define texture1D tex1D
37
+ #define texture2D tex2D
38
+ #define texture3D tex3D
39
+ #define texture2DArray tex2DARRAY
40
+ #define textureCube texCUBE
41
+ #define shadow2D tex2Dcmp
42
+ #define texture2DProj tex2Dproj
43
+ vec4 texture2DLod(sampler2D s, vec2 v, float lod) { return tex2Dlod(s, vec4(v.x, v.y, 0, lod)); }
44
+
45
+ #define samplerCube samplerCUBE
46
+ vec4 textureCubeLod(samplerCube s, vec3 v, float lod) { return texCUBElod(s, vec4(v.x, v.y, v.z, lod)); }
47
+
48
+ #define sampler2DShadow Sampler2DShadow
49
+
50
+ #define mix lerp
51
+ #define fract frac
52
+
53
+ float mod(float _a, float _b) { return _a - _b * floor(_a / _b); }
54
+ vec2 mod(vec2 _a, vec2 _b) { return _a - _b * floor(_a / _b); }
55
+ vec3 mod(vec3 _a, vec3 _b) { return _a - _b * floor(_a / _b); }
56
+ vec4 mod(vec4 _a, vec4 _b) { return _a - _b * floor(_a / _b); }
57
+
58
+ vec2 vec2_splat(float x) { return vec2(x, x); }
59
+ vec3 vec3_splat(float x) { return vec3(x, x, x); }
60
+ vec4 vec4_splat(float x) { return vec4(x, x, x, x); }
61
+
62
+ mat4 mtxFromRows(vec4 a, vec4 b, vec4 c, vec4 d)
63
+ {
64
+ return mat4(a, b, c, d);
65
+ }
66
+
67
+ mat3 mtxFromRows(vec3 a, vec3 b, vec3 c)
68
+ {
69
+ return mat3(a, b, c);
70
+ }
71
+
72
+ mat3 mtxFromCols(vec3 a, vec3 b, vec3 c)
73
+ {
74
+ return transpose(mat3(a, b, c));
75
+ }
76
+
77
+ #define STATIC static
78
+
79
+ #define OGRE_UNIFORMS_BEGIN
80
+ #define OGRE_UNIFORMS_END
81
+
82
+ #define MAIN_PARAMETERS void main(
83
+
84
+ #ifdef OGRE_VERTEX_SHADER
85
+ #define MAIN_DECLARATION out float4 gl_Position : POSITION)
86
+ #else
87
+ #define MAIN_DECLARATION in float4 gl_FragCoord : POSITION, out float4 gl_FragColor : COLOR)
88
+ #endif
89
+
90
+ #define IN(decl, sem) in decl : sem,
91
+ #define OUT(decl, sem) out decl : sem,
92
+ #elif defined(OGRE_METAL)
93
+ #define vec2 float2
94
+ #define vec3 float3
95
+ #define vec4 float4
96
+ #define mat3 metal::float3x3
97
+ #define mat4 metal::float4x4
98
+
99
+ #define IN(decl, sem) decl [[ attribute(sem) ]];
100
+ #else
101
+ // GLSL
102
+ #include "GLSL_GL3Support.glsl"
103
+
104
+ #ifndef USE_OGRE_FROM_FUTURE
105
+ #define _UNIFORM_BINDING(b)
106
+ #elif defined(VULKAN)
107
+ #define _UNIFORM_BINDING(b) layout(binding = b + 2) uniform
108
+ #elif __VERSION__ >= 420
109
+ #define _UNIFORM_BINDING(b) layout(binding = b) uniform
110
+ #else
111
+ #define _UNIFORM_BINDING(b) uniform
112
+ #endif
113
+
114
+ #define SAMPLER1D(name, reg) _UNIFORM_BINDING(reg) sampler1D name
115
+ #define SAMPLER2D(name, reg) _UNIFORM_BINDING(reg) sampler2D name
116
+ #define SAMPLER3D(name, reg) _UNIFORM_BINDING(reg) sampler3D name
117
+ #define SAMPLER2DARRAY(name, reg) _UNIFORM_BINDING(reg) sampler2DArray name
118
+ #define SAMPLERCUBE(name, reg) _UNIFORM_BINDING(reg) samplerCube name
119
+ #define SAMPLER2DSHADOW(name, reg) _UNIFORM_BINDING(reg) sampler2DShadow name
120
+
121
+ #define saturate(x) clamp(x, 0.0, 1.0)
122
+ #define mul(a, b) ((a) * (b))
123
+
124
+ #define vec2_splat vec2
125
+ #define vec3_splat vec3
126
+ #define vec4_splat vec4
127
+
128
+ mat4 mtxFromRows(vec4 a, vec4 b, vec4 c, vec4 d)
129
+ {
130
+ return transpose(mat4(a, b, c, d));
131
+ }
132
+
133
+ mat3 mtxFromRows(vec3 a, vec3 b, vec3 c)
134
+ {
135
+ return transpose(mat3(a, b, c));
136
+ }
137
+
138
+ mat3 mtxFromCols(vec3 a, vec3 b, vec3 c)
139
+ {
140
+ return mat3(a, b, c);
141
+ }
142
+
143
+ #define STATIC
144
+
145
+ #define MAIN_PARAMETERS
146
+ #define MAIN_DECLARATION void main()
147
+
148
+ #endif
149
+
150
+ #if !defined(OGRE_HLSL) && !defined(OGRE_CG)
151
+ // semantics as aliases for attribute locations
152
+ #define POSITION 0
153
+ #define BLENDWEIGHT 1
154
+ #define NORMAL 2
155
+ #define COLOR0 3
156
+ #define COLOR1 4
157
+ #define COLOR COLOR0
158
+ #define FOG 5
159
+ #define BLENDINDICES 7
160
+ #define TEXCOORD0 8
161
+ #define TEXCOORD1 9
162
+ #define TEXCOORD2 10
163
+ #define TEXCOORD3 11
164
+ #define TEXCOORD4 12
165
+ #define TEXCOORD5 13
166
+ #define TEXCOORD6 14
167
+ #define TEXCOORD7 15
168
+ #define TANGENT 14
169
+ #endif
170
+
171
+ #define OGRE_UNIFORMS(params) OGRE_UNIFORMS_BEGIN params OGRE_UNIFORMS_END
172
+
173
+ // GL_EXT_shader_explicit_arithmetic_types polyfill
174
+ #ifdef OGRE_GLSLES
175
+ #define float32_t highp float
176
+ #define f32vec2 highp vec2
177
+ #define f32vec3 highp vec3
178
+ #define f32vec4 highp vec4
179
+ #else
180
+ #define float32_t float
181
+ #define f32vec2 vec2
182
+ #define f32vec3 vec3
183
+ #define f32vec4 vec4
184
+ #endif