Browse Source

Added Skydome Shaders and Technique

rasteron 10 years ago
parent
commit
6789580e18

+ 22 - 0
bin/CoreData/Shaders/GLSL/Skydome.glsl

@@ -0,0 +1,22 @@
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+
+varying vec2 vTexCoord;
+
+uniform mat4 gl_ModelViewMatrix;
+uniform mat4 gl_ProjectionMatrix;
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    gl_Position.z = gl_Position.w;
+    vTexCoord = iTexCoord.xy;
+}
+
+void PS()
+{   
+    gl_FragColor = texture2D(sDiffMap, vTexCoord);       
+}

+ 22 - 0
bin/CoreData/Shaders/HLSL/Skydome.hlsl

@@ -0,0 +1,22 @@
+#include "Uniforms.hlsl"
+#include "Samplers.hlsl"
+#include "Transform.hlsl"
+
+void VS(float4 iPos : POSITION, 
+    float2 iTexCoord: TEXCOORD0,
+    out float2 oTexCoord : TEXCOORD0, 
+    out float4 oPos : SV_POSITION)
+{
+    float4x3 modelMatrix = iModelMatrix;
+    float3 worldPos = GetWorldPos(modelMatrix);
+    oPos = GetClipPos(worldPos);
+    
+    oPos.z = oPos.w;
+    oTexCoord = iTexCoord;
+}
+
+void PS(float2 iTexCoord : TEXCOORD0, 
+        out float4 oColor : OUTCOLOR0)
+{
+    oColor = cMatDiffColor * Sample2D(DiffMap, iTexCoord);
+}

+ 3 - 0
bin/CoreData/Techniques/DiffSkydome.xml

@@ -0,0 +1,3 @@
+<technique vs="Skydome" ps="Skydome">
+    <pass name="postopaque" depthwrite="false" />
+</technique>