ogre-python 14.5.0__cp314-cp314-win_amd64.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 (83) hide show
  1. Ogre/Bites.py +14 -0
  2. Ogre/Bullet.py +14 -0
  3. Ogre/Codec_Assimp.dll +0 -0
  4. Ogre/Codec_STBI.dll +0 -0
  5. Ogre/HighPy.py +389 -0
  6. Ogre/ImGui.py +12 -0
  7. Ogre/Numpy.py +80 -0
  8. Ogre/Ogre.py +12 -0
  9. Ogre/OgreBites.dll +0 -0
  10. Ogre/OgreBullet.dll +0 -0
  11. Ogre/OgreMain.dll +0 -0
  12. Ogre/OgreOverlay.dll +0 -0
  13. Ogre/OgrePaging.dll +0 -0
  14. Ogre/OgreRTShaderSystem.dll +0 -0
  15. Ogre/OgreTerrain.dll +0 -0
  16. Ogre/Overlay.py +14 -0
  17. Ogre/Plugin_DotScene.dll +0 -0
  18. Ogre/Plugin_GLSLangProgramManager.dll +0 -0
  19. Ogre/Plugin_OctreeSceneManager.dll +0 -0
  20. Ogre/Plugin_ParticleFX.dll +0 -0
  21. Ogre/RTShader.py +14 -0
  22. Ogre/RenderSystem_Direct3D11.dll +0 -0
  23. Ogre/RenderSystem_GL.dll +0 -0
  24. Ogre/RenderSystem_GL3Plus.dll +0 -0
  25. Ogre/RenderSystem_GLES2.dll +0 -0
  26. Ogre/RenderSystem_Tiny.dll +0 -0
  27. Ogre/RenderSystem_Vulkan.dll +0 -0
  28. Ogre/SDL2.dll +0 -0
  29. Ogre/Terrain.py +14 -0
  30. Ogre/_Bites.pyd +0 -0
  31. Ogre/_Bullet.pyd +0 -0
  32. Ogre/_ImGui.pyd +0 -0
  33. Ogre/_Ogre.pyd +0 -0
  34. Ogre/_Overlay.pyd +0 -0
  35. Ogre/_RTShader.pyd +0 -0
  36. Ogre/_Terrain.pyd +0 -0
  37. Ogre/__init__.py +2 -0
  38. Ogre/zlib.dll +0 -0
  39. ogre_python-14.5.0.data/data/Media/Main/DefaultShaders.metal +38 -0
  40. ogre_python-14.5.0.data/data/Media/Main/GLSL_GL3Support.glsl +110 -0
  41. ogre_python-14.5.0.data/data/Media/Main/HLSL_SM4Support.hlsl +124 -0
  42. ogre_python-14.5.0.data/data/Media/Main/OgreUnifiedShader.h +201 -0
  43. ogre_python-14.5.0.data/data/Media/Main/Shadow.material +85 -0
  44. ogre_python-14.5.0.data/data/Media/Main/ShadowBlend.frag +11 -0
  45. ogre_python-14.5.0.data/data/Media/Main/ShadowBlend.vert +12 -0
  46. ogre_python-14.5.0.data/data/Media/Main/ShadowExtrudeDirLight.vert +18 -0
  47. ogre_python-14.5.0.data/data/Media/Main/ShadowExtrudeDirLightFinite.vert +22 -0
  48. ogre_python-14.5.0.data/data/Media/Main/ShadowExtrudePointLight.vert +19 -0
  49. ogre_python-14.5.0.data/data/Media/Main/ShadowExtrudePointLightFinite.vert +22 -0
  50. ogre_python-14.5.0.data/data/Media/Main/ShadowVolumeExtude.program +41 -0
  51. ogre_python-14.5.0.data/data/Media/Main/spot_shadow_fade.dds +0 -0
  52. ogre_python-14.5.0.data/data/Media/RTShaderLib/FFPLib_AlphaTest.glsl +45 -0
  53. ogre_python-14.5.0.data/data/Media/RTShaderLib/FFPLib_Fog.glsl +92 -0
  54. ogre_python-14.5.0.data/data/Media/RTShaderLib/FFPLib_Texturing.glsl +150 -0
  55. ogre_python-14.5.0.data/data/Media/RTShaderLib/FFPLib_Transform.glsl +100 -0
  56. ogre_python-14.5.0.data/data/Media/RTShaderLib/RTSLib_Colour.glsl +16 -0
  57. ogre_python-14.5.0.data/data/Media/RTShaderLib/RTSLib_IBL.glsl +90 -0
  58. ogre_python-14.5.0.data/data/Media/RTShaderLib/RTSLib_LTC.glsl +114 -0
  59. ogre_python-14.5.0.data/data/Media/RTShaderLib/RTSLib_Lighting.glsl +18 -0
  60. ogre_python-14.5.0.data/data/Media/RTShaderLib/RTSSamplers.material +18 -0
  61. ogre_python-14.5.0.data/data/Media/RTShaderLib/SGXLib_CookTorrance.glsl +238 -0
  62. ogre_python-14.5.0.data/data/Media/RTShaderLib/SGXLib_DualQuaternion.glsl +172 -0
  63. ogre_python-14.5.0.data/data/Media/RTShaderLib/SGXLib_IntegratedPSSM.glsl +198 -0
  64. ogre_python-14.5.0.data/data/Media/RTShaderLib/SGXLib_LayeredBlending.glsl +825 -0
  65. ogre_python-14.5.0.data/data/Media/RTShaderLib/SGXLib_NormalMap.glsl +125 -0
  66. ogre_python-14.5.0.data/data/Media/RTShaderLib/SGXLib_PerPixelLighting.glsl +183 -0
  67. ogre_python-14.5.0.data/data/Media/RTShaderLib/SGXLib_TriplanarTexturing.glsl +47 -0
  68. ogre_python-14.5.0.data/data/Media/RTShaderLib/SGXLib_WBOIT.glsl +19 -0
  69. ogre_python-14.5.0.data/data/Media/RTShaderLib/dfgLUTmultiscatter.dds +0 -0
  70. ogre_python-14.5.0.data/data/Media/RTShaderLib/ltc_1.dds +0 -0
  71. ogre_python-14.5.0.data/data/Media/RTShaderLib/ltc_2.dds +0 -0
  72. ogre_python-14.5.0.data/data/Media/Terrain/TerrainSurface.glsl +91 -0
  73. ogre_python-14.5.0.data/data/Media/Terrain/TerrainTransforms.glsl +36 -0
  74. ogre_python-14.5.0.data/data/Media/packs/SdkTrays.zip +0 -0
  75. ogre_python-14.5.0.data/data/Media/packs/profiler.zip +0 -0
  76. ogre_python-14.5.0.data/data/bin/plugins.cfg +27 -0
  77. ogre_python-14.5.0.data/data/bin/resources.cfg +12 -0
  78. ogre_python-14.5.0.dist-info/METADATA +148 -0
  79. ogre_python-14.5.0.dist-info/RECORD +83 -0
  80. ogre_python-14.5.0.dist-info/WHEEL +5 -0
  81. ogre_python-14.5.0.dist-info/licenses/AUTHORS +313 -0
  82. ogre_python-14.5.0.dist-info/licenses/LICENSE +21 -0
  83. ogre_python-14.5.0.dist-info/top_level.txt +1 -0
@@ -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,110 @@
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) || defined(VULKAN))
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
+ // GL_EXT_shader_explicit_arithmetic_types polyfill
19
+ #if defined(VULKAN) || defined(OGRE_GLSLES) && (!defined(OGRE_FRAGMENT_SHADER) || __VERSION__ > 100)
20
+ #define float32_t highp float
21
+ #define f32vec2 highp vec2
22
+ #define f32vec3 highp vec3
23
+ #define f32vec4 highp vec4
24
+ #else
25
+ #define float32_t float
26
+ #define f32vec2 vec2
27
+ #define f32vec3 vec3
28
+ #define f32vec4 vec4
29
+ #endif
30
+
31
+ #if __VERSION__ == 100
32
+ mat2 transpose(mat2 m)
33
+ {
34
+ return mat2(m[0][0], m[1][0],
35
+ m[0][1], m[1][1]);
36
+ }
37
+
38
+ mat3 transpose(mat3 m)
39
+ {
40
+ return mat3(m[0][0], m[1][0], m[2][0],
41
+ m[0][1], m[1][1], m[2][1],
42
+ m[0][2], m[1][2], m[2][2]);
43
+ }
44
+
45
+ mat4 transpose(mat4 m)
46
+ {
47
+ return mat4(m[0][0], m[1][0], m[2][0], m[3][0],
48
+ m[0][1], m[1][1], m[2][1], m[3][1],
49
+ m[0][2], m[1][2], m[2][2], m[3][2],
50
+ m[0][3], m[1][3], m[2][3], m[3][3]);
51
+ }
52
+ #endif
53
+
54
+ #if __VERSION__ > 120 || defined(OGRE_GLSLANG)
55
+ #define texture1D texture
56
+ #define texture2D texture
57
+ #define texture3D texture
58
+ #define texture2DArray texture
59
+ #define textureCube texture
60
+ #define shadow2D texture
61
+ #define shadow2DProj textureProj
62
+ #define texture2DProj textureProj
63
+ #define texture2DLod textureLod
64
+ #define textureCubeLod textureLod
65
+
66
+ #if defined(OGRE_GLSLANG) || (__VERSION__ > 150 && defined(OGRE_VERTEX_SHADER)) || __VERSION__ >= 410
67
+ #define IN(decl, loc) layout(location = loc) in decl;
68
+ #else
69
+ #define IN(decl, loc) in decl;
70
+ #endif
71
+
72
+ #if defined(OGRE_GLSLANG) || (__VERSION__ > 150 && defined(OGRE_FRAGMENT_SHADER)) || __VERSION__ >= 410
73
+ #define OUT(decl, loc) layout(location = loc) out decl;
74
+ #else
75
+ #define OUT(decl, loc) out decl;
76
+ #endif
77
+
78
+ #else
79
+
80
+ #ifdef OGRE_VERTEX_SHADER
81
+ #define IN(decl, loc) attribute decl;
82
+ #define OUT(decl, loc) varying decl;
83
+ #else
84
+ #define IN(decl, loc) varying decl;
85
+ #define OUT(decl, loc) out decl;
86
+ #endif
87
+
88
+ #endif
89
+
90
+ #if defined(OGRE_FRAGMENT_SHADER) && (defined(OGRE_GLSLANG) || (__VERSION__ > 130))
91
+ #define gl_FragColor FragColor
92
+ OUT(vec4 FragColor, 0)
93
+ #endif
94
+
95
+ #ifdef OGRE_GLSLANG
96
+
97
+ #ifdef OGRE_VERTEX_SHADER
98
+ #define OGRE_UNIFORMS_BEGIN layout(binding = 0, row_major) uniform OgreUniforms {
99
+ #else
100
+ #define OGRE_UNIFORMS_BEGIN layout(binding = 1, row_major) uniform OgreUniforms {
101
+ #endif
102
+
103
+ #define OGRE_UNIFORMS_END };
104
+
105
+ #else
106
+
107
+ #define OGRE_UNIFORMS_BEGIN
108
+ #define OGRE_UNIFORMS_END
109
+
110
+ #endif
@@ -0,0 +1,124 @@
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
+ struct Sampler2DArrayShadow
79
+ {
80
+ Texture2DArray t;
81
+ SamplerComparisonState s;
82
+ };
83
+ struct SamplerCubeShadow
84
+ {
85
+ TextureCube t;
86
+ SamplerComparisonState s;
87
+ };
88
+
89
+ #define SAMPLER2DSHADOW(name, reg) \
90
+ Texture2D name ## Tex : register(t ## reg);\
91
+ SamplerComparisonState name ## State : register(s ## reg);\
92
+ static Sampler2DShadow name = {name ## Tex, name ## State}
93
+
94
+ #define SAMPLER2DARRAY(name, reg) \
95
+ Texture2DArray name ## Tex : register(t ## reg);\
96
+ SamplerState name ## State : register(s ## reg);\
97
+ static Sampler2DArray name = {name ## Tex, name ## State}
98
+
99
+ #define SAMPLER2DARRAYSHADOW(name, reg) \
100
+ Texture2DArray name ## Tex : register(t ## reg);\
101
+ SamplerComparisonState name ## State : register(s ## reg);\
102
+ static Sampler2DArrayShadow name = {name ## Tex, name ## State}
103
+
104
+ #define SAMPLERCUBESHADOW(name, reg) \
105
+ TextureCube name ## Tex : register(t ## reg);\
106
+ SamplerComparisonState name ## State : register(s ## reg);\
107
+ static SamplerCubeShadow name = {name ## Tex, name ## State}
108
+
109
+ float4 texSample(Sampler2DArray s, float3 v) { return s.t.Sample(s.s, v); }
110
+ float texSample(Sampler2DShadow s, float3 v) { return s.t.SampleCmpLevelZero(s.s, v.xy, v.z); }
111
+ float texSample(Sampler2DArrayShadow s, float4 v) { return s.t.SampleCmpLevelZero(s.s, v.xyz, v.w); }
112
+ float texSample(SamplerCubeShadow s, float4 v) { return s.t.SampleCmpLevelZero(s.s, v.xyz, v.w); }
113
+
114
+ // @deprecated to be removed with ogre 15
115
+ #define tex2Dcmp texSample
116
+ #define tex2DARRAY texSample
117
+ #else
118
+
119
+ #define SAMPLER1D(name, reg) sampler1D name : register(s ## reg)
120
+ #define SAMPLER2D(name, reg) sampler2D name : register(s ## reg)
121
+ #define SAMPLER3D(name, reg) sampler3D name : register(s ## reg)
122
+ #define SAMPLERCUBE(name, reg) samplerCUBE name : register(s ## reg)
123
+
124
+ #endif
@@ -0,0 +1,201 @@
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 15
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
+
27
+ #if OGRE_HLSL >= 4 && defined(OGRE_FRAGMENT_SHADER) && defined(USE_OGRE_FROM_FUTURE)
28
+ // #define float min16float - redefining float itself overwrites RTSS cbuffer parts
29
+ #define vec2 min16float2
30
+ #define vec3 min16float3
31
+ #define vec4 min16float4
32
+ #define mat3 min16float3x3
33
+ #define mat4 min16float4x4
34
+ #else
35
+ #define vec2 float2
36
+ #define vec3 float3
37
+ #define vec4 float4
38
+ #define mat3 float3x3
39
+ #define mat4 float4x4
40
+ #endif
41
+
42
+ #define float32_t float
43
+ #define f32vec2 float2
44
+ #define f32vec3 float3
45
+ #define f32vec4 float4
46
+
47
+ #define ivec2 int2
48
+ #define ivec3 int3
49
+ #define ivec4 int4
50
+
51
+ #define texture1D tex1D
52
+ #define texture2D tex2D
53
+ #define texture3D tex3D
54
+ #define texture2DArray texSample
55
+ #define textureCube texCUBE
56
+ #define shadow2D texSample
57
+ #define texture2DProj tex2Dproj
58
+ vec4 texture2DLod(sampler2D s, vec2 v, float lod) { return tex2Dlod(s, vec4(v.x, v.y, 0, lod)); }
59
+
60
+ #define samplerCube samplerCUBE
61
+ vec4 textureCubeLod(samplerCube s, vec3 v, float lod) { return texCUBElod(s, vec4(v.x, v.y, v.z, lod)); }
62
+
63
+ #define sampler2DArray Sampler2DArray
64
+ #define sampler2DShadow Sampler2DShadow
65
+ #define sampler2DArrayShadow Sampler2DArrayShadow
66
+ #define samplerCubeShadow SamplerCubeShadow
67
+
68
+ #define mix lerp
69
+ #define fract frac
70
+ #define inversesqrt rsqrt
71
+ #define dFdx ddx
72
+ #define dFdy ddy
73
+
74
+ float mod(float _a, float _b) { return _a - _b * floor(_a / _b); }
75
+ vec2 mod(float2 _a, float2 _b) { return _a - _b * floor(_a / _b); }
76
+ vec3 mod(float3 _a, float3 _b) { return _a - _b * floor(_a / _b); }
77
+ vec4 mod(float4 _a, float4 _b) { return _a - _b * floor(_a / _b); }
78
+
79
+ vec2 vec2_splat(float x) { return vec2(x, x); }
80
+ vec3 vec3_splat(float x) { return vec3(x, x, x); }
81
+ vec4 vec4_splat(float x) { return vec4(x, x, x, x); }
82
+
83
+ mat4 mtxFromRows(vec4 a, vec4 b, vec4 c, vec4 d)
84
+ {
85
+ return mat4(a, b, c, d);
86
+ }
87
+
88
+ mat3 mtxFromRows(vec3 a, vec3 b, vec3 c)
89
+ {
90
+ return mat3(a, b, c);
91
+ }
92
+
93
+ mat3 mtxFromCols(vec3 a, vec3 b, vec3 c)
94
+ {
95
+ return transpose(mat3(a, b, c));
96
+ }
97
+
98
+ #define STATIC static
99
+
100
+ #define OGRE_UNIFORMS_BEGIN
101
+ #define OGRE_UNIFORMS_END
102
+
103
+ #define MAIN_PARAMETERS void main(
104
+
105
+ #ifdef OGRE_VERTEX_SHADER
106
+ #define MAIN_DECLARATION out float4 gl_Position : POSITION)
107
+ #else
108
+ # if OGRE_HLSL > 3
109
+ # define VPOS POSITION
110
+ # endif
111
+ #define MAIN_DECLARATION in float4 gl_FragCoord : VPOS, out float4 gl_FragColor : COLOR)
112
+ #endif
113
+
114
+ #define IN(decl, sem) in decl : sem,
115
+ #define OUT(decl, sem) out decl : sem,
116
+ #elif defined(OGRE_METAL)
117
+
118
+ #define vec2 float2
119
+ #define vec3 float3
120
+ #define vec4 float4
121
+ #define mat3 metal::float3x3
122
+ #define mat4 metal::float4x4
123
+
124
+ #define float32_t float
125
+ #define f32vec2 float2
126
+ #define f32vec3 float3
127
+ #define f32vec4 float4
128
+
129
+ #define IN(decl, sem) decl [[ attribute(sem) ]];
130
+ #else
131
+ // GLSL
132
+ #include "GLSL_GL3Support.glsl"
133
+
134
+ #ifdef VULKAN
135
+ #define _UNIFORM_BINDING(b) layout(binding = b + 2) uniform
136
+ #elif __VERSION__ >= 420
137
+ #define _UNIFORM_BINDING(b) layout(binding = b) uniform
138
+ #else
139
+ #define _UNIFORM_BINDING(b) uniform
140
+ #endif
141
+
142
+ #define SAMPLER1D(name, reg) _UNIFORM_BINDING(reg) sampler1D name
143
+ #define SAMPLER2D(name, reg) _UNIFORM_BINDING(reg) sampler2D name
144
+ #define SAMPLER3D(name, reg) _UNIFORM_BINDING(reg) sampler3D name
145
+ #define SAMPLER2DARRAY(name, reg) _UNIFORM_BINDING(reg) sampler2DArray name
146
+ #define SAMPLERCUBE(name, reg) _UNIFORM_BINDING(reg) samplerCube name
147
+ #define SAMPLER2DSHADOW(name, reg) _UNIFORM_BINDING(reg) sampler2DShadow name
148
+ #define SAMPLER2DARRAYSHADOW(name, reg) _UNIFORM_BINDING(reg) sampler2DArrayShadow name
149
+ #define SAMPLERCUBESHADOW(name, reg) _UNIFORM_BINDING(reg) samplerCubeShadow name
150
+
151
+ #define saturate(x) clamp(x, 0.0, 1.0)
152
+ #define mul(a, b) ((a) * (b))
153
+
154
+ #define vec2_splat vec2
155
+ #define vec3_splat vec3
156
+ #define vec4_splat vec4
157
+
158
+ mat4 mtxFromRows(vec4 a, vec4 b, vec4 c, vec4 d)
159
+ {
160
+ return transpose(mat4(a, b, c, d));
161
+ }
162
+
163
+ mat3 mtxFromRows(vec3 a, vec3 b, vec3 c)
164
+ {
165
+ return transpose(mat3(a, b, c));
166
+ }
167
+
168
+ mat3 mtxFromCols(vec3 a, vec3 b, vec3 c)
169
+ {
170
+ return mat3(a, b, c);
171
+ }
172
+
173
+ #define STATIC
174
+
175
+ #define MAIN_PARAMETERS
176
+ #define MAIN_DECLARATION void main()
177
+
178
+ #endif
179
+
180
+ #if !defined(OGRE_HLSL) && !defined(OGRE_CG)
181
+ // semantics as aliases for attribute locations
182
+ #define POSITION 0
183
+ #define BLENDWEIGHT 1
184
+ #define NORMAL 2
185
+ #define COLOR0 3
186
+ #define COLOR1 4
187
+ #define COLOR COLOR0
188
+ #define FOG 5
189
+ #define BLENDINDICES 7
190
+ #define TEXCOORD0 8
191
+ #define TEXCOORD1 9
192
+ #define TEXCOORD2 10
193
+ #define TEXCOORD3 11
194
+ #define TEXCOORD4 12
195
+ #define TEXCOORD5 13
196
+ #define TEXCOORD6 14
197
+ #define TEXCOORD7 15
198
+ #define TANGENT 14
199
+ #endif
200
+
201
+ #define OGRE_UNIFORMS(params) OGRE_UNIFORMS_BEGIN params OGRE_UNIFORMS_END
@@ -0,0 +1,85 @@
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
+ material Ogre/TextureShadowCaster
6
+ {
7
+ receive_shadows false
8
+ technique
9
+ {
10
+ pass
11
+ {
12
+ // Lighting has to be on, because we need shadow coloured objects
13
+ // Note that because we can't predict vertex programs, we'll have to
14
+ // bind light values to those, and so we bind White to ambient
15
+ // reflectance, and we'll set the ambient colour to the shadow colour
16
+ ambient 1 1 1
17
+ diffuse 0 0 0
18
+ specular 0 0 0 1
19
+ emissive 0 0 0
20
+ fog_override true none
21
+ // set depth bias in case this is used with PF_DEPTH
22
+ depth_bias -1 -1
23
+ }
24
+ }
25
+ }
26
+
27
+ material Ogre/StencilShadowModulationPass
28
+ {
29
+ technique
30
+ {
31
+ pass
32
+ {
33
+ lighting off
34
+ scene_blend modulate
35
+ depth_write off
36
+ depth_check off
37
+ cull_hardware none
38
+
39
+ vertex_program_ref Ogre/ShadowBlendVP {}
40
+ fragment_program_ref Ogre/ShadowBlendFP {}
41
+ texture_unit {}
42
+ }
43
+ }
44
+ }
45
+
46
+ material Ogre/StencilShadowVolumes
47
+ {
48
+ technique
49
+ {
50
+ pass
51
+ {
52
+ // program will be set dynamically to match light type
53
+ vertex_program_ref Ogre/ShadowExtrudeDirLightFinite
54
+ {
55
+ // however, the parameters here are shared between all programs
56
+ param_named_auto worldviewproj_matrix worldviewproj_matrix
57
+ param_named_auto light_position_object_space light_position_object_space 0
58
+ param_named_auto shadow_extrusion_distance shadow_extrusion_distance 0
59
+ }
60
+ fragment_program_ref Ogre/ShadowBlendFP {}
61
+ }
62
+ }
63
+ }
64
+
65
+ material Ogre/Debug/ShadowVolumes
66
+ {
67
+ technique
68
+ {
69
+ pass
70
+ {
71
+ depth_write off
72
+ scene_blend add
73
+ cull_hardware none
74
+
75
+ // program will be set dynamically to match light type
76
+ vertex_program_ref Ogre/ShadowExtrudeDirLight
77
+ {
78
+ // however, the parameters here are shared between all programs
79
+ param_named_auto worldviewproj_matrix worldviewproj_matrix
80
+ param_named_auto light_position_object_space light_position_object_space 0
81
+ }
82
+ fragment_program_ref Ogre/ShadowBlendFP {}
83
+ }
84
+ }
85
+ }
@@ -0,0 +1,11 @@
1
+ #include <OgreUnifiedShader.h>
2
+
3
+ OGRE_UNIFORMS(
4
+ uniform vec4 shadowColor;
5
+ )
6
+
7
+ MAIN_PARAMETERS
8
+ MAIN_DECLARATION
9
+ {
10
+ gl_FragColor = shadowColor;
11
+ }
@@ -0,0 +1,12 @@
1
+ #include <OgreUnifiedShader.h>
2
+
3
+ OGRE_UNIFORMS(
4
+ uniform mat4 worldViewProj;
5
+ )
6
+
7
+ MAIN_PARAMETERS
8
+ IN(vec4 vertex, POSITION)
9
+ MAIN_DECLARATION
10
+ {
11
+ gl_Position = mul(worldViewProj, vertex);
12
+ }
@@ -0,0 +1,18 @@
1
+ #include <OgreUnifiedShader.h>
2
+
3
+ // Directional light extrude
4
+ uniform mat4 worldviewproj_matrix;
5
+ uniform vec4 light_position_object_space; // homogenous, object space
6
+
7
+ MAIN_PARAMETERS
8
+ IN(vec4 uv0, TEXCOORD0)
9
+ IN(vec4 position, POSITION)
10
+ MAIN_DECLARATION
11
+ {
12
+ // Extrusion in object space
13
+ // Vertex unmodified if w==1, extruded if w==0
14
+ vec4 newpos =
15
+ (uv0.xxxx * (position + light_position_object_space)) - light_position_object_space;
16
+
17
+ gl_Position = mul(worldviewproj_matrix, newpos);
18
+ }
@@ -0,0 +1,22 @@
1
+ #include <OgreUnifiedShader.h>
2
+
3
+ // Directional light extrude - FINITE
4
+ uniform mat4 worldviewproj_matrix;
5
+ uniform vec4 light_position_object_space; // homogenous, object space
6
+ uniform float shadow_extrusion_distance; // how far to extrude
7
+
8
+ MAIN_PARAMETERS
9
+ IN(vec4 uv0, TEXCOORD0)
10
+ IN(vec4 position, POSITION)
11
+ MAIN_DECLARATION
12
+ {
13
+ // Extrusion in object space
14
+ // Vertex unmodified if w==1, extruded if w==0
15
+ vec3 extrusionDir = - light_position_object_space.xyz;
16
+ extrusionDir = normalize(extrusionDir);
17
+
18
+ vec4 newpos = vec4(position.xyz +
19
+ ((1.0 - uv0.x) * shadow_extrusion_distance * extrusionDir), 1.0);
20
+
21
+ gl_Position = mul(worldviewproj_matrix, newpos);
22
+ }
@@ -0,0 +1,19 @@
1
+ #include <OgreUnifiedShader.h>
2
+
3
+ // Point light shadow volume extrude
4
+ uniform mat4 worldviewproj_matrix;
5
+ uniform vec4 light_position_object_space; // homogenous, object space
6
+
7
+ MAIN_PARAMETERS
8
+ IN(vec4 uv0, TEXCOORD0)
9
+ IN(vec4 position, POSITION)
10
+ MAIN_DECLARATION
11
+ {
12
+ // Extrusion in object space
13
+ // Vertex unmodified if w==1, extruded if w==0
14
+ vec4 newpos =
15
+ (uv0.xxxx * light_position_object_space) +
16
+ vec4(position.xyz - light_position_object_space.xyz, 0.0);
17
+
18
+ gl_Position = mul(worldviewproj_matrix, newpos);
19
+ }
@@ -0,0 +1,22 @@
1
+ #include <OgreUnifiedShader.h>
2
+
3
+ // Point light shadow volume extrude - FINITE
4
+ uniform mat4 worldviewproj_matrix;
5
+ uniform vec4 light_position_object_space; // homogenous, object space
6
+ uniform float shadow_extrusion_distance; // how far to extrude
7
+
8
+ MAIN_PARAMETERS
9
+ IN(vec4 uv0, TEXCOORD0)
10
+ IN(vec4 position, POSITION)
11
+ MAIN_DECLARATION
12
+ {
13
+ // Extrusion in object space
14
+ // Vertex unmodified if w==1, extruded if w==0
15
+ vec3 extrusionDir = position.xyz - light_position_object_space.xyz;
16
+ extrusionDir = normalize(extrusionDir);
17
+
18
+ vec4 newpos = vec4(position.xyz +
19
+ ((1.0 - uv0.x) * shadow_extrusion_distance * extrusionDir), 1.0);
20
+
21
+ gl_Position = mul(worldviewproj_matrix, newpos);
22
+ }