ogre-python 14.2.3__cp312-cp312-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 (81) 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/ImGui.py +12 -0
  6. Ogre/Numpy.py +59 -0
  7. Ogre/Ogre.py +12 -0
  8. Ogre/OgreBites.dll +0 -0
  9. Ogre/OgreBullet.dll +0 -0
  10. Ogre/OgreMain.dll +0 -0
  11. Ogre/OgreOverlay.dll +0 -0
  12. Ogre/OgrePaging.dll +0 -0
  13. Ogre/OgreRTShaderSystem.dll +0 -0
  14. Ogre/OgreTerrain.dll +0 -0
  15. Ogre/Overlay.py +14 -0
  16. Ogre/Plugin_DotScene.dll +0 -0
  17. Ogre/Plugin_GLSLangProgramManager.dll +0 -0
  18. Ogre/Plugin_OctreeSceneManager.dll +0 -0
  19. Ogre/Plugin_ParticleFX.dll +0 -0
  20. Ogre/RTShader.py +14 -0
  21. Ogre/RenderSystem_Direct3D11.dll +0 -0
  22. Ogre/RenderSystem_GL.dll +0 -0
  23. Ogre/RenderSystem_GL3Plus.dll +0 -0
  24. Ogre/RenderSystem_GLES2.dll +0 -0
  25. Ogre/RenderSystem_Tiny.dll +0 -0
  26. Ogre/RenderSystem_Vulkan.dll +0 -0
  27. Ogre/SDL2.dll +0 -0
  28. Ogre/Terrain.py +14 -0
  29. Ogre/_Bites.pyd +0 -0
  30. Ogre/_Bullet.pyd +0 -0
  31. Ogre/_ImGui.pyd +0 -0
  32. Ogre/_Ogre.pyd +0 -0
  33. Ogre/_Overlay.pyd +0 -0
  34. Ogre/_RTShader.pyd +0 -0
  35. Ogre/_Terrain.pyd +0 -0
  36. Ogre/__init__.py +2 -0
  37. Ogre/zlib.dll +0 -0
  38. ogre_python-14.2.3.data/data/Media/Main/DefaultShaders.metal +38 -0
  39. ogre_python-14.2.3.data/data/Media/Main/GLSL_GL3Support.glsl +97 -0
  40. ogre_python-14.2.3.data/data/Media/Main/HLSL_SM4Support.hlsl +98 -0
  41. ogre_python-14.2.3.data/data/Media/Main/OgreUnifiedShader.h +183 -0
  42. ogre_python-14.2.3.data/data/Media/Main/Shadow.material +85 -0
  43. ogre_python-14.2.3.data/data/Media/Main/ShadowBlend.frag +11 -0
  44. ogre_python-14.2.3.data/data/Media/Main/ShadowBlend.vert +12 -0
  45. ogre_python-14.2.3.data/data/Media/Main/ShadowExtrudeDirLight.vert +18 -0
  46. ogre_python-14.2.3.data/data/Media/Main/ShadowExtrudeDirLightFinite.vert +22 -0
  47. ogre_python-14.2.3.data/data/Media/Main/ShadowExtrudePointLight.vert +19 -0
  48. ogre_python-14.2.3.data/data/Media/Main/ShadowExtrudePointLightFinite.vert +22 -0
  49. ogre_python-14.2.3.data/data/Media/Main/ShadowVolumeExtude.program +41 -0
  50. ogre_python-14.2.3.data/data/Media/Main/spot_shadow_fade.dds +0 -0
  51. ogre_python-14.2.3.data/data/Media/RTShaderLib/FFPLib_AlphaTest.glsl +45 -0
  52. ogre_python-14.2.3.data/data/Media/RTShaderLib/FFPLib_Fog.glsl +92 -0
  53. ogre_python-14.2.3.data/data/Media/RTShaderLib/FFPLib_Texturing.glsl +144 -0
  54. ogre_python-14.2.3.data/data/Media/RTShaderLib/FFPLib_Transform.glsl +100 -0
  55. ogre_python-14.2.3.data/data/Media/RTShaderLib/RTSLib_IBL.glsl +88 -0
  56. ogre_python-14.2.3.data/data/Media/RTShaderLib/RTSLib_LTC.glsl +114 -0
  57. ogre_python-14.2.3.data/data/Media/RTShaderLib/RTSLib_Lighting.glsl +18 -0
  58. ogre_python-14.2.3.data/data/Media/RTShaderLib/RTSSamplers.material +17 -0
  59. ogre_python-14.2.3.data/data/Media/RTShaderLib/SGXLib_CookTorrance.glsl +246 -0
  60. ogre_python-14.2.3.data/data/Media/RTShaderLib/SGXLib_DualQuaternion.glsl +172 -0
  61. ogre_python-14.2.3.data/data/Media/RTShaderLib/SGXLib_IntegratedPSSM.glsl +183 -0
  62. ogre_python-14.2.3.data/data/Media/RTShaderLib/SGXLib_LayeredBlending.glsl +825 -0
  63. ogre_python-14.2.3.data/data/Media/RTShaderLib/SGXLib_NormalMap.glsl +125 -0
  64. ogre_python-14.2.3.data/data/Media/RTShaderLib/SGXLib_PerPixelLighting.glsl +172 -0
  65. ogre_python-14.2.3.data/data/Media/RTShaderLib/SGXLib_TriplanarTexturing.glsl +47 -0
  66. ogre_python-14.2.3.data/data/Media/RTShaderLib/SGXLib_WBOIT.glsl +19 -0
  67. ogre_python-14.2.3.data/data/Media/RTShaderLib/dfgLUTmultiscatter.dds +0 -0
  68. ogre_python-14.2.3.data/data/Media/RTShaderLib/ltc_1.dds +0 -0
  69. ogre_python-14.2.3.data/data/Media/RTShaderLib/ltc_2.dds +0 -0
  70. ogre_python-14.2.3.data/data/Media/Terrain/TerrainSurface.glsl +83 -0
  71. ogre_python-14.2.3.data/data/Media/Terrain/TerrainTransforms.glsl +36 -0
  72. ogre_python-14.2.3.data/data/Media/packs/SdkTrays.zip +0 -0
  73. ogre_python-14.2.3.data/data/Media/packs/profiler.zip +0 -0
  74. ogre_python-14.2.3.data/data/bin/plugins.cfg +27 -0
  75. ogre_python-14.2.3.data/data/bin/resources.cfg +12 -0
  76. ogre_python-14.2.3.dist-info/AUTHORS +312 -0
  77. ogre_python-14.2.3.dist-info/LICENSE +21 -0
  78. ogre_python-14.2.3.dist-info/METADATA +125 -0
  79. ogre_python-14.2.3.dist-info/RECORD +81 -0
  80. ogre_python-14.2.3.dist-info/WHEEL +5 -0
  81. ogre_python-14.2.3.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 vec2 newTexCoord)
61
+ {
62
+ //Calculate eye direction
63
+ vec3 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.0f - 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.0f - 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.0f - 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.0f - 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,172 @@
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 OGRE_HLSL
44
+ void SGX_Flip_Backface_Normal(in float triArea, in float targetFlipped, inout vec3 normal)
45
+ {
46
+ #if OGRE_HLSL == 3
47
+ triArea *= -1.0;
48
+ triArea *= targetFlipped;
49
+ #endif
50
+ if(triArea < 0.0)
51
+ normal *= -1.0;
52
+ }
53
+ #else
54
+ void SGX_Flip_Backface_Normal(in bool frontFacing, in float targetFlipped, inout vec3 normal)
55
+ {
56
+ if(!frontFacing)
57
+ normal *= -1.0;
58
+ }
59
+ #endif
60
+
61
+ void evaluateLight(
62
+ in vec3 vNormal,
63
+ in vec3 vViewPos,
64
+ in vec4 vLightPos,
65
+ in vec4 vAttParams,
66
+ in vec4 vLightDirView,
67
+ in vec4 spotParams,
68
+ in vec4 vDiffuseColour,
69
+ inout vec3 vOutDiffuse
70
+ #if defined(TVC_DIFFUSE) || defined(TVC_SPECULAR)
71
+ , in vec4 vInVertexColour
72
+ #endif
73
+ #ifdef USE_SPECULAR
74
+ , in vec4 vSpecularColour,
75
+ in float fSpecularPower,
76
+ inout vec3 vOutSpecular
77
+ #endif
78
+ #ifdef SHADOWLIGHT_COUNT
79
+ , in float shadowFactor
80
+ #endif
81
+ #ifdef HAVE_AREA_LIGHTS
82
+ , in sampler2D ltcLUT1,
83
+ in sampler2D ltcLUT2
84
+ #endif
85
+ )
86
+ {
87
+
88
+ vec3 vLightView = vLightPos.xyz;
89
+ float fLightD = 0.0;
90
+
91
+ #ifdef TVC_DIFFUSE
92
+ vDiffuseColour *= vInVertexColour;
93
+ #endif
94
+
95
+ #ifdef HAVE_AREA_LIGHTS
96
+ if(spotParams.w == 2.0)
97
+ {
98
+ // rect area light
99
+ vec3 dcol = vDiffuseColour.rgb;
100
+ #ifdef USE_SPECULAR
101
+ #ifdef TVC_SPECULAR
102
+ vSpecularColour *= vInVertexColour;
103
+ #endif
104
+ vec3 scol = vSpecularColour.rgb;
105
+ #else
106
+ vec3 scol = vec3_splat(0.0);
107
+ float fSpecularPower = 0.0;
108
+ #endif
109
+ float roughness = saturate(1.0 - fSpecularPower/128.0); // convert specular to roughness
110
+ roughness *= roughness; // perceptual to physical roughness
111
+ evaluateRectLight(ltcLUT1, ltcLUT2, roughness, normalize(vNormal), vViewPos, vLightPos.xyz, spotParams.xyz, vAttParams.xyz, scol, dcol);
112
+
113
+ #ifdef SHADOWLIGHT_COUNT
114
+ dcol *= shadowFactor;
115
+ scol *= shadowFactor;
116
+ #endif
117
+
118
+ // linear to gamma
119
+ dcol = pow(dcol, vec3_splat(1.0/2.2));
120
+ vOutDiffuse.rgb = saturate(vOutDiffuse.rgb + dcol);
121
+ #ifdef USE_SPECULAR
122
+ scol = pow(scol, vec3_splat(1.0/2.2));
123
+ vOutSpecular.rgb = saturate(vOutSpecular.rgb + scol);
124
+ #endif
125
+ return;
126
+ }
127
+ #endif
128
+
129
+ if (vLightPos.w != 0.0)
130
+ {
131
+ vLightView -= vViewPos; // to light
132
+ fLightD = length(vLightView);
133
+
134
+ if(fLightD > vAttParams.x)
135
+ return;
136
+ }
137
+
138
+ vLightView = normalize(vLightView);
139
+ vec3 vNormalView = normalize(vNormal);
140
+ float nDotL = saturate(dot(vNormalView, vLightView));
141
+
142
+ if (nDotL <= 0.0)
143
+ return;
144
+
145
+ float fAtten = getDistanceAttenuation(vAttParams.yzw, fLightD);
146
+
147
+ #ifdef SHADOWLIGHT_COUNT
148
+ fAtten *= shadowFactor;
149
+ #endif
150
+
151
+ if(spotParams.w != 0.0)
152
+ {
153
+ fAtten *= getAngleAttenuation(spotParams.xyz, vLightDirView.xyz, vLightView);
154
+ }
155
+
156
+ vOutDiffuse += vDiffuseColour.rgb * nDotL * fAtten;
157
+ vOutDiffuse = saturate(vOutDiffuse);
158
+
159
+ #ifdef USE_SPECULAR
160
+ vec3 vView = -normalize(vViewPos);
161
+ vec3 vHalfWay = normalize(vView + vLightView);
162
+ float nDotH = saturate(dot(vNormalView, vHalfWay));
163
+ #ifdef TVC_SPECULAR
164
+ vSpecularColour *= vInVertexColour;
165
+ #endif
166
+ #ifdef NORMALISED
167
+ vSpecularColour *= (fSpecularPower + 8.0)/(8.0 * M_PI);
168
+ #endif
169
+ vOutSpecular += vSpecularColour.rgb * pow(nDotH, fSpecularPower) * fAtten;
170
+ vOutSpecular = saturate(vOutSpecular);
171
+ #endif
172
+ }
@@ -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,83 @@
1
+ void transformToTS(in vec3 TSnormal, in mat3 normalMatrix, inout vec3 normal)
2
+ {
3
+ // derive the tangent space basis
4
+ // we do this in the pixel shader because we don't have per-vertex normals
5
+ // because of the LOD, we use a normal map
6
+ // tangent is always +x or -z in object space depending on alignment
7
+ #ifdef TERRAIN_ALIGN_Y_Z
8
+ vec3 tangent = vec3(0, 0, -1);
9
+ #else
10
+ vec3 tangent = vec3(1, 0, 0);
11
+ #endif
12
+ normal = normalize(normal);
13
+ tangent = normalize(mul(normalMatrix, tangent));
14
+ vec3 binormal = cross(tangent, normal);
15
+ // note, now we need to re-cross to derive tangent again because it wasn't orthonormal
16
+ tangent = cross(normal, binormal);
17
+ // derive final matrix
18
+ mat3 TBN = mtxFromCols(tangent, binormal, normal);
19
+
20
+ normal = mul(TBN, TSnormal);
21
+ }
22
+
23
+ void getShadowFactor(in sampler2D lightmap, in vec2 uv, inout float shadowFactor)
24
+ {
25
+ float lmShadow = texture2D(lightmap, uv).x;
26
+ shadowFactor = min(shadowFactor, lmShadow);
27
+ }
28
+
29
+ #define MIN_BLEND_WEIGHT 0.0039 // 1/255
30
+
31
+ void blendTerrainLayer(in float blendWeight, in f32vec2 uv0, in float uvMul,
32
+ #ifdef TERRAIN_PARALLAX_MAPPING
33
+ in vec3 viewPos, in float scaleBias, in mat3 TBN,
34
+ #endif
35
+ #ifdef TERRAIN_NORMAL_MAPPING
36
+ in sampler2D normtex, inout vec3 normal,
37
+ #endif
38
+ in sampler2D difftex, inout vec4 diffuseSpec)
39
+ {
40
+ if(blendWeight < MIN_BLEND_WEIGHT)
41
+ return;
42
+
43
+ // generate UV
44
+ vec2 uv = mod(uv0 * uvMul, 1.0);
45
+
46
+ #ifdef TERRAIN_PARALLAX_MAPPING
47
+ SGX_Generate_Parallax_Texcoord(normtex, uv, viewPos, scaleBias, TBN, uv);
48
+ #endif
49
+
50
+ // sample diffuse texture
51
+ vec4 diffuseSpecTex = texture2D(difftex, uv);
52
+ // apply to common
53
+ diffuseSpec = mix(diffuseSpec, diffuseSpecTex, blendWeight);
54
+
55
+ #ifdef TERRAIN_NORMAL_MAPPING
56
+ vec3 TSnormal;
57
+ // access TS normal map
58
+ SGX_FetchNormal(normtex, uv, TSnormal);
59
+ // Partial Derivative Blending https://blog.selfshadow.com/publications/blending-in-detail/
60
+ normal = normalize(vec3(mix(normal.xy*TSnormal.z, TSnormal.xy*normal.z, blendWeight), TSnormal.z*normal.z));
61
+ #endif
62
+ }
63
+
64
+ //-----------------------------------------------------------------------------
65
+ void SGX_CalculateTerrainTBN(in vec3 normal, in mat3 normalMatrix, out mat3 TBN)
66
+ {
67
+ // derive the tangent space basis
68
+ // we do this in the pixel shader because we don't have per-vertex normals
69
+ // because of the LOD, we use a normal map
70
+ // tangent is always +x or -z in object space depending on alignment
71
+ #ifdef TERRAIN_ALIGN_Y_Z
72
+ vec3 tangent = vec3(0, 0, -1);
73
+ #else
74
+ vec3 tangent = vec3(1, 0, 0);
75
+ #endif
76
+ normal = normalize(normal);
77
+ tangent = normalize(mul(normalMatrix, tangent));
78
+ vec3 binormal = cross(tangent, normal);
79
+ // note, now we need to re-cross to derive tangent again because it wasn't orthonormal
80
+ tangent = cross(normal, binormal);
81
+ // derive final matrix
82
+ TBN = mtxFromCols(tangent, binormal, normal);
83
+ }
@@ -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
+