Przeglądaj źródła

Bugfix: Update default shader to correct BSL syntax

BearishSun 7 lat temu
rodzic
commit
72471e8f1a
1 zmienionych plików z 7 dodań i 18 usunięć
  1. 7 18
      Data/EmptyShaderText.txt

+ 7 - 18
Data/EmptyShaderText.txt

@@ -1,35 +1,24 @@
 #include "$ENGINE$\BasePass.bslinc"
 #include "$ENGINE$\BasePass.bslinc"
+#include "$ENGINE$\GBufferOutput.bslinc"
 
 
-technique Surface
+shader Surface
 {
 {
 	mixin BasePass;
 	mixin BasePass;
+	mixin GBufferOutput;
 
 
 	code
 	code
 	{
 	{
-		SamplerState gAlbedoSamp;
-		SamplerState gNormalSamp;
-		SamplerState gRoughnessSamp;
-		SamplerState gMetalnessSamp;
-		
-		Texture2D gAlbedoTex;
-		Texture2D gNormalTex;
-		Texture2D gRoughnessTex;
-		Texture2D gMetalnessTex;
-		
 		void fsmain(
 		void fsmain(
 			in VStoFS input, 
 			in VStoFS input, 
 			out float4 OutGBufferA : SV_Target0,
 			out float4 OutGBufferA : SV_Target0,
 			out float4 OutGBufferB : SV_Target1,
 			out float4 OutGBufferB : SV_Target1,
 			out float2 OutGBufferC : SV_Target2)
 			out float2 OutGBufferC : SV_Target2)
 		{
 		{
-			float3 normal = normalize(gNormalTex.Sample(gNormalSamp, input.uv0) * 2.0f - float3(1, 1, 1));
-			float3 worldNormal = calcWorldNormal(input, normal);
-		
 			SurfaceData surfaceData;
 			SurfaceData surfaceData;
-			surfaceData.albedo = gAlbedoTex.Sample(gAlbedoSamp, input.uv0);
-			surfaceData.worldNormal.xyz = worldNormal;
-			surfaceData.roughness = gRoughnessTex.Sample(gRoughnessSamp, input.uv0).x;
-			surfaceData.metalness = gMetalnessTex.Sample(gMetalnessSamp, input.uv0).x;
+			surfaceData.albedo = float4(0.05f, 0.05f, 0.05f, 1.0f);
+			surfaceData.worldNormal.xyz = input.tangentToWorldZ;
+			surfaceData.roughness = 1.0f;
+			surfaceData.metalness = 0.0f;
 			
 			
 			encodeGBuffer(surfaceData, OutGBufferA, OutGBufferB, OutGBufferC);
 			encodeGBuffer(surfaceData, OutGBufferA, OutGBufferB, OutGBufferC);
 		}	
 		}