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,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
+ }
@@ -0,0 +1,41 @@
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
+ vertex_program Ogre/ShadowBlendVP glsl glsles hlsl glslang
6
+ {
7
+ source ShadowBlend.vert
8
+ default_params
9
+ {
10
+ param_named_auto worldViewProj worldviewproj_matrix
11
+ }
12
+ }
13
+
14
+ fragment_program Ogre/ShadowBlendFP glsl glsles hlsl glslang
15
+ {
16
+ source ShadowBlend.frag
17
+ default_params
18
+ {
19
+ param_named_auto shadowColor shadow_colour
20
+ }
21
+ }
22
+
23
+ vertex_program Ogre/ShadowExtrudePointLight glsl glsles hlsl
24
+ {
25
+ source ShadowExtrudePointLight.vert
26
+ }
27
+
28
+ vertex_program Ogre/ShadowExtrudeDirLight glsl glsles hlsl
29
+ {
30
+ source ShadowExtrudeDirLight.vert
31
+ }
32
+
33
+ vertex_program Ogre/ShadowExtrudePointLightFinite glsl glsles hlsl
34
+ {
35
+ source ShadowExtrudePointLightFinite.vert
36
+ }
37
+
38
+ vertex_program Ogre/ShadowExtrudeDirLightFinite glsl glsles hlsl
39
+ {
40
+ source ShadowExtrudeDirLightFinite.vert
41
+ }
@@ -0,0 +1,45 @@
1
+ //-----------------------------------------------------------------------------
2
+ // Program Name: FFPLib_AlphaTest
3
+ // Program Desc: Alpha test function.
4
+ // Program Type: Vertex/Pixel shader
5
+ // Language: GLSL
6
+ //-----------------------------------------------------------------------------
7
+
8
+ #define CMPF_ALWAYS_FAIL 0
9
+ #define CMPF_ALWAYS_PASS 1
10
+ #define CMPF_LESS 2
11
+ #define CMPF_LESS_EQUAL 3
12
+ #define CMPF_EQUAL 4
13
+ #define CMPF_NOT_EQUAL 5
14
+ #define CMPF_GREATER_EQUAL 6
15
+ #define CMPF_GREATER 7
16
+
17
+ bool Alpha_Func(in int func, in float alphaRef, in float alphaValue)
18
+ {
19
+ // ES2 does not have switch
20
+ if(func == CMPF_ALWAYS_PASS)
21
+ return true;
22
+ else if(func == CMPF_LESS)
23
+ return alphaValue < alphaRef;
24
+ else if(func == CMPF_LESS_EQUAL)
25
+ return alphaValue <= alphaRef;
26
+ else if(func == CMPF_EQUAL)
27
+ return alphaValue == alphaRef;
28
+ else if(func == CMPF_NOT_EQUAL)
29
+ return alphaValue != alphaRef;
30
+ else if(func == CMPF_GREATER_EQUAL)
31
+ return alphaValue >= alphaRef;
32
+ else if(func == CMPF_GREATER)
33
+ return alphaValue > alphaRef;
34
+
35
+ // CMPF_ALWAYS_FAIL and default
36
+ return false;
37
+ }
38
+
39
+
40
+ void FFP_Alpha_Test(in float func, in float alphaRef, in vec4 texel)
41
+ {
42
+ bool pass_ = Alpha_Func(int(func), alphaRef, texel.a);
43
+ if (!pass_)
44
+ discard;
45
+ }
@@ -0,0 +1,92 @@
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: FFPLib_Fog
30
+ // Program Desc: Fog functions of the FFP.
31
+ // Program Type: Vertex/Pixel shader
32
+ // Language: GLSL
33
+ // Notes: Implements core functions needed by FFPFog class.
34
+ // Based on fog engine.
35
+ // See http://msdn.microsoft.com/en-us/library/bb173398.aspx
36
+ // Vertex based fog: the w component of the out position is used
37
+ // as the distance parameter to fog formulas. This is basically the z coordinate
38
+ // in world space. See pixel fog under D3D docs. The fog factor is computed according
39
+ // to each formula, then clamped and output to the pixel shader.
40
+ // Pixel based fog: the w component of the out position is passed to pixel shader
41
+ // that computes the fog factor based on it.
42
+ // Both techniques use the fog factor in the end of the pixel shader to blend
43
+ // the output color with the fog color.
44
+ //-----------------------------------------------------------------------------
45
+
46
+ #define FOG_EXP 1
47
+ #define FOG_EXP2 2
48
+ #define FOG_LINEAR 3
49
+
50
+ //-----------------------------------------------------------------------------
51
+ void FFP_FogFactor(in float depth,
52
+ in vec4 fogParams,
53
+ out float oFogFactor)
54
+ {
55
+ float distance = abs(depth);
56
+
57
+ #if FOG_TYPE == FOG_LINEAR
58
+ float fogFactor = (fogParams.z - distance) * fogParams.w;
59
+ #elif FOG_TYPE == FOG_EXP
60
+ float x = distance*fogParams.x;
61
+ float fogFactor = 1.0 / exp(x);
62
+ #elif FOG_TYPE == FOG_EXP2
63
+ float x = (distance*fogParams.x*distance*fogParams.x);
64
+ float fogFactor = 1.0 / exp(x);
65
+ #endif
66
+
67
+ oFogFactor = saturate(fogFactor);
68
+ }
69
+
70
+ //-----------------------------------------------------------------------------
71
+ void FFP_PixelFog_PositionDepth(in mat4 mWorld,
72
+ in vec3 cameraPos,
73
+ in vec4 pos,
74
+ out vec3 oPosView,
75
+ out float oDepth)
76
+ {
77
+ vec4 vOutPos = mul(mWorld, pos);
78
+ oPosView = vOutPos.xyz - cameraPos;
79
+ oDepth = length(oPosView);
80
+ }
81
+
82
+ //-----------------------------------------------------------------------------
83
+ void FFP_PixelFog(in float depth,
84
+ in vec4 fogParams,
85
+ in vec4 fogColor,
86
+ in vec4 baseColor,
87
+ out vec4 oColor)
88
+ {
89
+ float fogFactor = 0.0;
90
+ FFP_FogFactor(depth, fogParams, fogFactor);
91
+ oColor = mix(fogColor, baseColor, fogFactor);
92
+ }
@@ -0,0 +1,144 @@
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: FFPLib_Texturing
30
+ // Program Desc: Texture functions of the FFP.
31
+ // Program Type: Vertex/Pixel shader
32
+ // Language: GLSL
33
+ // Notes: Implements core functions for FFPTexturing class.
34
+ // based on texturing operations needed by render system.
35
+ // Implements texture coordinate processing:
36
+ // see http://msdn.microsoft.com/en-us/library/bb206247.aspx
37
+ // Implements texture blending operation:
38
+ // see http://msdn.microsoft.com/en-us/library/bb206241.aspx
39
+ //-----------------------------------------------------------------------------
40
+
41
+ //-----------------------------------------------------------------------------
42
+ void FFP_TransformTexCoord(in mat4 m, in vec2 v, out vec2 vOut)
43
+ {
44
+ vOut = mul(m, vec4(v, 0.0, 1.0)).xy;
45
+ }
46
+ //-----------------------------------------------------------------------------
47
+ void FFP_TransformTexCoord(in mat4 m, in vec4 v, out vec2 vOut)
48
+ {
49
+ vOut = mul(m, v).xy;
50
+ }
51
+
52
+ //-----------------------------------------------------------------------------
53
+ void FFP_TransformTexCoord(in mat4 m, in vec3 v, out vec3 vOut)
54
+ {
55
+ vOut = mul(m, vec4(v, 1.0)).xyz;
56
+ }
57
+
58
+ //-----------------------------------------------------------------------------
59
+ void FFP_GenerateTexCoord_EnvMap_Normal(in mat3 mWorldIT,
60
+ in vec3 vNormal,
61
+ out vec3 vOut)
62
+ {
63
+ vOut = normalize(mul(mWorldIT, vNormal));
64
+ }
65
+
66
+ //-----------------------------------------------------------------------------
67
+ void FFP_GenerateTexCoord_EnvMap_Sphere(in mat4 mWorldView,
68
+ in mat3 mWorldIT,
69
+ in vec4 vPos,
70
+ in vec3 vNormal,
71
+ out vec2 vOut)
72
+ {
73
+ vec3 normal = normalize( mul(mWorldIT, vNormal));
74
+ vec3 eyedir = normalize(mul(mWorldView, vPos)).xyz;
75
+ vec3 r = reflect(eyedir, normal);
76
+ r.z += 1.0;
77
+ float two_p = 2.0 * length(r);
78
+ vOut = vec2(0.5 + r.x / two_p, 0.5 - r.y / two_p);
79
+ }
80
+
81
+ //-----------------------------------------------------------------------------
82
+ void FFP_GenerateTexCoord_EnvMap_Reflect(in mat4 mWorld,
83
+ in mat4 mWorldIT,
84
+ in vec3 vCamPos,
85
+ in vec3 vNormal,
86
+ in vec4 vPos,
87
+ out vec3 vOut)
88
+ {
89
+ vec3 vWorldNormal = normalize(mul(mWorldIT, vec4(vNormal, 0.0)).xyz);
90
+ vec3 vWorldPos = mul(mWorld, vPos).xyz;
91
+ vec3 vEyeDir = normalize(vWorldPos - vCamPos);
92
+
93
+ vec3 vReflect = reflect(vEyeDir, vWorldNormal);
94
+ vReflect.z *= -1.0;
95
+
96
+ vOut = vReflect;
97
+ }
98
+
99
+ //-----------------------------------------------------------------------------
100
+ void FFP_AddSmooth(in float vIn0, in float vIn1, out float vOut)
101
+ {
102
+ vOut = vIn0 + vIn1 - (vIn0 * vIn1);
103
+ }
104
+
105
+ //-----------------------------------------------------------------------------
106
+ void FFP_AddSmooth(in vec2 vIn0, in vec2 vIn1, out vec2 vOut)
107
+ {
108
+ vOut = vIn0 + vIn1 - (vIn0 * vIn1);
109
+ }
110
+
111
+ //-----------------------------------------------------------------------------
112
+ void FFP_AddSmooth(in vec3 vIn0, in vec3 vIn1, out vec3 vOut)
113
+ {
114
+ vOut = vIn0 + vIn1 - (vIn0 * vIn1);
115
+ }
116
+
117
+ //-----------------------------------------------------------------------------
118
+ void FFP_AddSmooth(in vec4 vIn0, in vec4 vIn1, out vec4 vOut)
119
+ {
120
+ vOut = vIn0 + vIn1 - (vIn0 * vIn1);
121
+ }
122
+ //-----------------------------------------------------------------------------
123
+ void FFP_DotProduct(in float vIn0, in float vIn1, out float vOut)
124
+ {
125
+ vOut = dot(vIn0, vIn1);
126
+ }
127
+
128
+ //-----------------------------------------------------------------------------
129
+ void FFP_DotProduct(in vec2 vIn0, in vec2 vIn1, out vec2 vOut)
130
+ {
131
+ vOut = vec2_splat(dot(vIn0, vIn1));
132
+ }
133
+
134
+ //-----------------------------------------------------------------------------
135
+ void FFP_DotProduct(in vec3 vIn0, in vec3 vIn1, out vec3 vOut)
136
+ {
137
+ vOut = vec3_splat(dot(vIn0, vIn1));
138
+ }
139
+
140
+ //-----------------------------------------------------------------------------
141
+ void FFP_DotProduct(in vec4 vIn0, in vec4 vIn1, out vec4 vOut)
142
+ {
143
+ vOut = vec4_splat(dot(vIn0, vIn1));
144
+ }
@@ -0,0 +1,100 @@
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: FFPLib_Transform
30
+ // Program Desc: Transform functions of the FFP.
31
+ // Program Type: Vertex shader
32
+ // Language: GLSL
33
+ // Notes: Implements core functions for FFPTransform class.
34
+ // based on transform engine.
35
+ // See http://msdn.microsoft.com/en-us/library/bb206269.aspx
36
+ //-----------------------------------------------------------------------------
37
+
38
+ //-----------------------------------------------------------------------------
39
+ void FFP_Transform(in mat4 m,
40
+ in vec4 v,
41
+ out vec3 vOut)
42
+ {
43
+ vOut = mul(m, v).xyz;
44
+ }
45
+
46
+ #ifdef OGRE_HLSL
47
+ void FFP_Transform(in float3x4 m,
48
+ in float4 v,
49
+ out float3 vOut)
50
+ {
51
+ vOut = mul(m, v);
52
+ }
53
+
54
+ //-----------------------------------------------------------------------------
55
+ void FFP_Transform(in float3x4 m,
56
+ in float3 v,
57
+ out float3 vOut)
58
+ {
59
+ vOut = mul((float3x3)m, v);
60
+ }
61
+ #elif !defined(OGRE_GLSLES) || OGRE_GLSLES > 100
62
+ //-----------------------------------------------------------------------------
63
+ void FFP_Transform(in mat3x4 m,
64
+ in vec4 v,
65
+ out vec3 vOut)
66
+ {
67
+ /* transpose non-square uniform matrix for correct row-major > column-major mapping
68
+ * to keep the indexing inside the shader so mat[0] returns the same data in both GLSL and HLSL
69
+ * although it will be the first row in HLSL and the first column in GLSL
70
+ */
71
+ vOut = v * m;
72
+ }
73
+
74
+ void FFP_Transform(in mat3x4 m,
75
+ in vec3 v,
76
+ out vec3 vOut)
77
+ {
78
+ vOut = v * mat3(m);
79
+ }
80
+ #endif
81
+
82
+ //-----------------------------------------------------------------------------
83
+ void FFP_Transform(in mat4 m,
84
+ in vec3 v,
85
+ out vec3 vOut)
86
+ {
87
+ #ifdef OGRE_HLSL
88
+ vOut = mul((float3x3)m, v);
89
+ #else
90
+ vOut = mat3(m) * v;
91
+ #endif
92
+ }
93
+
94
+ //-----------------------------------------------------------------------------
95
+ void FFP_DerivePointSize(in vec4 params,
96
+ in float d,
97
+ out float sz)
98
+ {
99
+ sz = params.x/sqrt(params.y + params.z*d + params.w*d*d);
100
+ }