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,125 @@
1
+ /*
2
+ -----------------------------------------------------------------------------
3
+ This source file is part of OGRE
4
+ (Object-oriented Graphics Rendering Engine)
5
+ For the latest info, see http://www.ogre3d.org
6
+
7
+ Copyright (c) 2000-2014 Torus Knot Software Ltd
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+ -----------------------------------------------------------------------------
26
+ */
27
+
28
+ //-----------------------------------------------------------------------------
29
+ // Program Name: SGXLib_NormalMapLighting
30
+ // Program Desc: Normal map lighting functions.
31
+ // Program Type: Vertex/Pixel shader
32
+ // Language: GLSL
33
+ //-----------------------------------------------------------------------------
34
+
35
+ //-----------------------------------------------------------------------------
36
+ void SGX_FetchNormal(in sampler2D s,
37
+ in vec2 uv,
38
+ out vec3 vOut)
39
+ {
40
+ vOut = 2.0 * texture2D(s, uv).xyz - 1.0;
41
+ }
42
+
43
+ //-----------------------------------------------------------------------------
44
+ void SGX_CalculateTBN(in vec3 vNormal,
45
+ in vec4 vTangent,
46
+ out mat3 TBN)
47
+ {
48
+ vec3 vBinormal = cross(vNormal, vTangent.xyz) * vTangent.w;
49
+
50
+ // direction: from tangent space to world
51
+ TBN = mtxFromCols(vTangent.xyz, vBinormal, vNormal);
52
+ }
53
+
54
+ //-----------------------------------------------------------------------------
55
+ void SGX_Generate_Parallax_Texcoord(in sampler2D normalHeightMap,
56
+ in vec2 texCoord,
57
+ in vec3 viewPos,
58
+ in float heightScale,
59
+ in mat3 TBN,
60
+ out f32vec2 newTexCoord)
61
+ {
62
+ //Calculate eye direction
63
+ f32vec3 eyeVec = mul(-viewPos, TBN);
64
+ eyeVec = normalize(eyeVec);
65
+ #ifndef TERRAIN_PARALLAX_MAPPING
66
+ eyeVec.y = -eyeVec.y; //Inverse y
67
+ #endif
68
+
69
+ newTexCoord = texCoord;
70
+
71
+ #ifndef POM_LAYER_COUNT
72
+ //Simple parallax mapping
73
+ float height = 1.0 - texture2D(normalHeightMap, newTexCoord).a;
74
+
75
+ #ifndef TERRAIN_PARALLAX_MAPPING
76
+ vec2 p = eyeVec.xy / eyeVec.z * (height * heightScale);
77
+ #else
78
+ vec2 p = eyeVec.xy * (height * heightScale);
79
+ #endif
80
+
81
+ newTexCoord = newTexCoord - p;
82
+ #else
83
+ // parallax occlusion mapping
84
+ #ifdef POM_MAX_DISTANCE
85
+ if (abs(viewPos.z) > POM_MAX_DISTANCE)
86
+ return;
87
+ #endif
88
+
89
+ //Configure steep mapping layering.
90
+ float layerDepth = 1.0 / float(POM_LAYER_COUNT);
91
+ float currentLayerDepth = 0.0;
92
+ vec2 parallaxShift = (eyeVec.xy) * heightScale;
93
+ vec2 deltaTexCoords = parallaxShift / float(POM_LAYER_COUNT);
94
+
95
+ float currentDepthMapValue = 1.0 - texture2D(normalHeightMap, newTexCoord).a;
96
+
97
+ //Loop through layers and break early if match found.
98
+ for (int currentLayerId = 0; currentLayerId < POM_LAYER_COUNT; currentLayerId++)
99
+ {
100
+ // shift texture coordinates along direction of P
101
+ newTexCoord -= deltaTexCoords;
102
+
103
+ // get depthmap value at current texture coordinates
104
+ currentDepthMapValue = 1.0 - texture2D(normalHeightMap, newTexCoord).a;
105
+
106
+ //Break if layer height matched
107
+ if (currentLayerDepth > currentDepthMapValue)
108
+ break;
109
+
110
+ // get depth of next layer
111
+ currentLayerDepth += layerDepth;
112
+ }
113
+
114
+ // get texture coordinates before collision (reverse operations)
115
+ vec2 prevTexCoords = newTexCoord + deltaTexCoords;
116
+
117
+ // get depth after and before collision for linear interpolation
118
+ float afterDepth = currentDepthMapValue - currentLayerDepth;
119
+ float beforeDepth = (1.0 - texture2D(normalHeightMap, prevTexCoords).a) - currentLayerDepth + layerDepth;
120
+
121
+ // interpolation of texture coordinates
122
+ float weight = afterDepth / (afterDepth - beforeDepth);
123
+ newTexCoord = mix(newTexCoord, prevTexCoords, weight);
124
+ #endif
125
+ }
@@ -0,0 +1,183 @@
1
+ /*
2
+ -----------------------------------------------------------------------------
3
+ This source file is part of OGRE
4
+ (Object-oriented Graphics Rendering Engine)
5
+ For the latest info, see http://www.ogre3d.org
6
+
7
+ Copyright (c) 2000-2014 Torus Knot Software Ltd
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+ -----------------------------------------------------------------------------
26
+ */
27
+
28
+ //-----------------------------------------------------------------------------
29
+ // Program Name: SGXLib_Lighting
30
+ // Program Desc: Per pixel lighting functions.
31
+ // Program Type: Vertex/Pixel shader
32
+ // Language: GLSL
33
+ // Notes: Implements core functions for FFPLighting class.
34
+ // based on lighting engine.
35
+ // See http://msdn.microsoft.com/en-us/library/bb147178.aspx
36
+ //-----------------------------------------------------------------------------
37
+
38
+ #include "RTSLib_Lighting.glsl"
39
+ #ifdef HAVE_AREA_LIGHTS
40
+ #include "RTSLib_LTC.glsl"
41
+ #endif
42
+
43
+ #ifdef USE_LINEAR_COLOURS
44
+ #define FFP_SATURATE(x) x
45
+ #else
46
+ #define FFP_SATURATE(x) saturate(x)
47
+ #endif
48
+
49
+ #ifdef OGRE_HLSL
50
+ void SGX_Flip_Backface_Normal(in float triArea, in float targetFlipped, inout vec3 normal)
51
+ {
52
+ #if OGRE_HLSL == 3
53
+ triArea *= -1.0;
54
+ triArea *= targetFlipped;
55
+ #endif
56
+ if(triArea < 0.0)
57
+ normal *= -1.0;
58
+ }
59
+ #else
60
+ void SGX_Flip_Backface_Normal(in bool frontFacing, in float targetFlipped, inout vec3 normal)
61
+ {
62
+ if(!frontFacing)
63
+ normal *= -1.0;
64
+ }
65
+ #endif
66
+
67
+ void evaluateLight(
68
+ in vec3 vNormal,
69
+ in f32vec3 vViewPos,
70
+ in vec4 vLightPos,
71
+ in vec4 vAttParams,
72
+ in vec4 vLightDirView,
73
+ in vec4 spotParams,
74
+ in vec4 vDiffuseColour,
75
+ inout vec3 vOutDiffuse
76
+ #if defined(TVC_DIFFUSE) || defined(TVC_SPECULAR)
77
+ , in vec4 vInVertexColour
78
+ #endif
79
+ #ifdef USE_SPECULAR
80
+ , in vec4 vSpecularColour,
81
+ in float fSpecularPower,
82
+ inout vec3 vOutSpecular
83
+ #endif
84
+ #ifdef SHADOWLIGHT_COUNT
85
+ , in float shadowFactor
86
+ #endif
87
+ #ifdef HAVE_AREA_LIGHTS
88
+ , in sampler2D ltcLUT1,
89
+ in sampler2D ltcLUT2
90
+ #endif
91
+ )
92
+ {
93
+
94
+ vec3 vLightView = vLightPos.xyz;
95
+ float fLightD = 0.0;
96
+
97
+ #ifdef TVC_DIFFUSE
98
+ vDiffuseColour *= vInVertexColour;
99
+ #endif
100
+
101
+ #ifdef HAVE_AREA_LIGHTS
102
+ if(spotParams.w == 2.0)
103
+ {
104
+ // rect area light
105
+ vec3 dcol = vDiffuseColour.rgb;
106
+ #ifdef USE_SPECULAR
107
+ #ifdef TVC_SPECULAR
108
+ vSpecularColour *= vInVertexColour;
109
+ #endif
110
+ vec3 scol = vSpecularColour.rgb;
111
+ #else
112
+ vec3 scol = vec3_splat(0.0);
113
+ float fSpecularPower = 0.0;
114
+ #endif
115
+ float roughness = saturate(1.0 - fSpecularPower/128.0); // convert specular to roughness
116
+ roughness *= roughness; // perceptual to physical roughness
117
+ evaluateRectLight(ltcLUT1, ltcLUT2, roughness, normalize(vNormal), vViewPos, vLightPos.xyz, spotParams.xyz, vAttParams.xyz, scol, dcol);
118
+
119
+ #ifdef SHADOWLIGHT_COUNT
120
+ dcol *= shadowFactor;
121
+ scol *= shadowFactor;
122
+ #endif
123
+
124
+ // linear to gamma
125
+ dcol = pow(dcol, vec3_splat(1.0/2.2));
126
+ vOutDiffuse.rgb = FFP_SATURATE(vOutDiffuse.rgb + dcol);
127
+ #ifdef USE_SPECULAR
128
+ scol = pow(scol, vec3_splat(1.0/2.2));
129
+ vOutSpecular.rgb = FFP_SATURATE(vOutSpecular.rgb + scol);
130
+ #endif
131
+ return;
132
+ }
133
+ #endif
134
+
135
+ if (vLightPos.w != 0.0)
136
+ {
137
+ f32vec3 tmp = vLightPos.xyz - vViewPos;
138
+ fLightD = length(tmp);
139
+
140
+ if(fLightD > vAttParams.x)
141
+ return;
142
+
143
+ vLightView = tmp / fLightD; // normalize
144
+ }
145
+ else
146
+ {
147
+ vLightView = normalize(vLightView);
148
+ }
149
+
150
+ vec3 vNormalView = normalize(vNormal);
151
+ float nDotL = saturate(dot(vNormalView, vLightView));
152
+
153
+ if (nDotL <= 0.0)
154
+ return;
155
+
156
+ float fAtten = getDistanceAttenuation(vAttParams.yzw, fLightD);
157
+
158
+ #ifdef SHADOWLIGHT_COUNT
159
+ fAtten *= shadowFactor;
160
+ #endif
161
+
162
+ if(spotParams.w != 0.0)
163
+ {
164
+ fAtten *= getAngleAttenuation(spotParams.xyz, vLightDirView.xyz, vLightView);
165
+ }
166
+
167
+ vOutDiffuse += vDiffuseColour.rgb * nDotL * fAtten;
168
+ vOutDiffuse = FFP_SATURATE(vOutDiffuse);
169
+
170
+ #ifdef USE_SPECULAR
171
+ f32vec3 vView = -normalize(vViewPos);
172
+ f32vec3 vHalfWay = normalize(vView + vLightView);
173
+ float32_t nDotH = saturate(dot(vNormalView, vHalfWay));
174
+ #ifdef TVC_SPECULAR
175
+ vSpecularColour *= vInVertexColour;
176
+ #endif
177
+ #ifdef NORMALISED
178
+ vSpecularColour *= (fSpecularPower + 8.0)/(8.0 * M_PI);
179
+ #endif
180
+ vOutSpecular += vSpecularColour.rgb * pow(nDotH, fSpecularPower) * fAtten;
181
+ vOutSpecular = FFP_SATURATE(vOutSpecular);
182
+ #endif
183
+ }
@@ -0,0 +1,47 @@
1
+ /*
2
+ -----------------------------------------------------------------------------
3
+ This source file is part of OGRE
4
+ (Object-oriented Graphics Rendering Engine)
5
+ For the latest info, see http://www.ogre3d.org
6
+
7
+ Copyright (c) 2000-2014 Torus Knot Software Ltd
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+ -----------------------------------------------------------------------------
26
+ */
27
+
28
+ void SGX_TriplanarTexturing(in vec4 diffuse, in vec3 normal, in vec4 position, in sampler2D texFromX, in sampler2D texFromY, in sampler2D texFromZ, in vec3 parameters, out vec4 cOut)
29
+ {
30
+ vec3 blendWeights = abs(normalize(normal));
31
+ blendWeights = blendWeights - parameters.y;
32
+ blendWeights = pow(max(blendWeights, vec3(0.0, 0.0, 0.0)), parameters.zzz);
33
+ float tot = (blendWeights.x + blendWeights.y + blendWeights.z);
34
+ blendWeights /= vec3(tot, tot, tot);
35
+ // Move the planar mapping a bit according to the normal length to avoid bad looking skirts.
36
+ float nLength = length(normal - 1.0);
37
+ vec2 coord1 = (position.yz + nLength) * parameters.x;
38
+ vec2 coord2 = (position.zx + nLength) * parameters.x;
39
+ vec2 coord3 = (position.xy + nLength) * parameters.x;
40
+
41
+ vec4 col1 = texture2D(texFromX, coord1);
42
+ vec4 col2 = texture2D(texFromY, coord2);
43
+ vec4 col3 = texture2D(texFromZ, coord3);
44
+ cOut = diffuse * vec4(col1.xyz * blendWeights.x +
45
+ col2.xyz * blendWeights.y +
46
+ col3.xyz * blendWeights.z, 1);
47
+ }
@@ -0,0 +1,19 @@
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
+ // SPDX-License-Identifier: MIT
5
+
6
+ float weight(float z, float a)
7
+ {
8
+ // from https://casual-effects.blogspot.com/2015/03/implemented-weighted-blended-order.html
9
+ return clamp(pow(min(1.0, a * 10.0) + 0.01, 3.0) * 1e8 * pow(1.0 - z * 0.9, 3.0), 1e-2, 3e3);
10
+ }
11
+
12
+ void SGX_WBOIT(float depth, inout vec4 accum, out vec4 revealage)
13
+ {
14
+ vec4 colour = accum;
15
+ // Weighted Blended Order-Independent Transparency, Listing 4
16
+ float w = weight(depth, colour.a);
17
+ accum = vec4(colour.rgb * w * colour.a, colour.a);
18
+ revealage = vec4_splat(colour.a * w);
19
+ }
@@ -0,0 +1,91 @@
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
+ // SPDX-License-Identifier: MIT
5
+
6
+ #include "RTSLib_Colour.glsl"
7
+
8
+ void transformToTS(in vec3 TSnormal, in mat3 normalMatrix, inout vec3 normal)
9
+ {
10
+ // derive the tangent space basis
11
+ // we do this in the pixel shader because we don't have per-vertex normals
12
+ // because of the LOD, we use a normal map
13
+ // tangent is always +x or -z in object space depending on alignment
14
+ #ifdef TERRAIN_ALIGN_Y_Z
15
+ vec3 tangent = vec3(0, 0, -1);
16
+ #else
17
+ vec3 tangent = vec3(1, 0, 0);
18
+ #endif
19
+ normal = normalize(normal);
20
+ tangent = normalize(mul(normalMatrix, tangent));
21
+ vec3 binormal = cross(tangent, normal);
22
+ // note, now we need to re-cross to derive tangent again because it wasn't orthonormal
23
+ tangent = cross(normal, binormal);
24
+ // derive final matrix
25
+ mat3 TBN = mtxFromCols(tangent, binormal, normal);
26
+
27
+ normal = mul(TBN, TSnormal);
28
+ }
29
+
30
+ void getShadowFactor(in sampler2D lightmap, in vec2 uv, inout float shadowFactor)
31
+ {
32
+ float lmShadow = texture2D(lightmap, uv).x;
33
+ shadowFactor = min(shadowFactor, lmShadow);
34
+ }
35
+
36
+ #define MIN_BLEND_WEIGHT 0.0039 // 1/255
37
+
38
+ void blendTerrainLayer(in float blendWeight, in f32vec2 uv0, in float uvMul,
39
+ #ifdef TERRAIN_PARALLAX_MAPPING
40
+ in vec3 viewPos, in float scaleBias, in mat3 TBN,
41
+ #endif
42
+ #ifdef TERRAIN_NORMAL_MAPPING
43
+ in sampler2D normtex, inout vec3 normal,
44
+ #endif
45
+ in sampler2D difftex, inout vec4 diffuseSpec)
46
+ {
47
+ if(blendWeight < MIN_BLEND_WEIGHT)
48
+ return;
49
+
50
+ // generate UV
51
+ vec2 uv = mod(uv0 * uvMul, 1.0);
52
+
53
+ #ifdef TERRAIN_PARALLAX_MAPPING
54
+ SGX_Generate_Parallax_Texcoord(normtex, uv, viewPos, scaleBias, TBN, uv);
55
+ #endif
56
+
57
+ // sample diffuse texture
58
+ vec4 diffuseSpecTex = texture2D(difftex, uv);
59
+ ENABLE_LINEAR_COLOUR(diffuseSpecTex);
60
+ // apply to common
61
+ diffuseSpec = mix(diffuseSpec, diffuseSpecTex, blendWeight);
62
+
63
+ #ifdef TERRAIN_NORMAL_MAPPING
64
+ vec3 TSnormal;
65
+ // access TS normal map
66
+ SGX_FetchNormal(normtex, uv, TSnormal);
67
+ // Partial Derivative Blending https://blog.selfshadow.com/publications/blending-in-detail/
68
+ normal = normalize(vec3(mix(normal.xy*TSnormal.z, TSnormal.xy*normal.z, blendWeight), TSnormal.z*normal.z));
69
+ #endif
70
+ }
71
+
72
+ //-----------------------------------------------------------------------------
73
+ void SGX_CalculateTerrainTBN(in vec3 normal, in mat3 normalMatrix, out mat3 TBN)
74
+ {
75
+ // derive the tangent space basis
76
+ // we do this in the pixel shader because we don't have per-vertex normals
77
+ // because of the LOD, we use a normal map
78
+ // tangent is always +x or -z in object space depending on alignment
79
+ #ifdef TERRAIN_ALIGN_Y_Z
80
+ vec3 tangent = vec3(0, 0, -1);
81
+ #else
82
+ vec3 tangent = vec3(1, 0, 0);
83
+ #endif
84
+ normal = normalize(normal);
85
+ tangent = normalize(mul(normalMatrix, tangent));
86
+ vec3 binormal = cross(tangent, normal);
87
+ // note, now we need to re-cross to derive tangent again because it wasn't orthonormal
88
+ tangent = cross(normal, binormal);
89
+ // derive final matrix
90
+ TBN = mtxFromCols(tangent, binormal, normal);
91
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @param delta: lodDelta, lodThreshold (vertex attribute)
3
+ * @param lodMorph: morph amount, morph targetLOD (uniform)
4
+ */
5
+ void applyLODMorph(vec2 delta, vec2 lodMorph, inout float height
6
+ #ifdef TERRAIN_DEBUG
7
+ , out vec2 lodInfo
8
+ #endif
9
+ )
10
+ {
11
+ // determine whether to apply the LOD morph to this vertex
12
+ // we store the deltas against all vertices so we only want to apply
13
+ // the morph to the ones which would disappear.
14
+ // If we subtract
15
+ // the lodThreshold from the targetLOD, and arrange to only morph if the
16
+ // result is negative (it will only be -1 in fact, since after that
17
+ // the vertex will never be indexed), we will achieve our aim.
18
+ // sign(lodThreshold - targetLOD) == -1 is to morph
19
+
20
+ // this will either be 1 (morph) or 0 (don't morph)
21
+ float toMorph = -min(0.0, sign(delta.y - lodMorph.y));
22
+ height += delta.x * toMorph * lodMorph.x;
23
+
24
+ #ifdef TERRAIN_DEBUG
25
+ // LOD level (-1 since value is target level, we want to display actual)
26
+ lodInfo.x = (lodMorph.y - 1) / NUM_LODS;
27
+ // LOD morph
28
+ lodInfo.y = toMorph * lodMorph.x;
29
+ #endif
30
+ }
31
+
32
+ void expandVertex(mat4 idxToObjectSpace, float baseUVScale, vec2 idx, float height, out vec4 position, out vec2 uv)
33
+ {
34
+ position = mul(idxToObjectSpace, vec4(idx, height, 1));
35
+ uv = vec2(idx.x * baseUVScale, 1.0 - idx.y * baseUVScale);
36
+ }
@@ -0,0 +1,27 @@
1
+ # Defines plugins to load
2
+
3
+ # Define plugin folder
4
+ PluginFolder=.
5
+
6
+ # Define plugins
7
+ # Plugin=RenderSystem_Direct3D9
8
+ Plugin=RenderSystem_Direct3D11
9
+ Plugin=RenderSystem_GL
10
+ Plugin=RenderSystem_GL3Plus
11
+ Plugin=RenderSystem_GLES2
12
+ # Plugin=RenderSystem_Metal
13
+ Plugin=RenderSystem_Tiny
14
+ Plugin=RenderSystem_Vulkan
15
+ Plugin=Plugin_ParticleFX
16
+ # Plugin=Plugin_BSPSceneManager
17
+ # Plugin=Plugin_CgProgramManager
18
+ Plugin=Plugin_GLSLangProgramManager
19
+ # Plugin=Codec_EXR
20
+ Plugin=Codec_STBI
21
+ # Plugin=Codec_RsImage
22
+ # Plugin=Codec_FreeImage
23
+ # Plugin=Plugin_PCZSceneManager
24
+ # Plugin=Plugin_OctreeZone
25
+ Plugin=Plugin_OctreeSceneManager
26
+ Plugin=Plugin_DotScene
27
+ Plugin=Codec_Assimp
@@ -0,0 +1,12 @@
1
+ # Ogre Core Resources
2
+ [OgreInternal]
3
+ FileSystem=../Media/Main
4
+ FileSystem=../Media/RTShaderLib
5
+ FileSystem=../Media/Terrain/
6
+
7
+ # Resources required by OgreBites::Trays
8
+ [Essential]
9
+ Zip=../Media/packs/SdkTrays.zip
10
+ Zip=../Media/packs/profiler.zip
11
+
12
+