Default.bsl 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #include "$ENGINE$\DeferredBasePass.bslinc"
  2. Technique : base("Surface") =
  3. {
  4. Language = "HLSL11";
  5. Pass =
  6. {
  7. Fragment =
  8. {
  9. float4 main(
  10. in VStoFS input,
  11. out float4 OutGBufferA : SV_Target1,
  12. out float4 OutGBufferB : SV_Target2) : SV_Target0
  13. {
  14. GBufferData gbufferData;
  15. gbufferData.albedo = float4(0.05f, 0.05f, 0.05f, 1.0f);
  16. gbufferData.worldNormal.xyz = input.tangentToWorldZ;
  17. encodeGBuffer(gbufferData, OutGBufferA, OutGBufferB);
  18. // TODO - Just returning a simple ambient term, use better environment lighting later
  19. return float4(gbufferData.albedo.rgb, 1.0f);
  20. }
  21. };
  22. };
  23. };
  24. Technique : base("Surface") =
  25. {
  26. Language = "GLSL";
  27. Pass =
  28. {
  29. Fragment =
  30. {
  31. layout(location = 0) in vec2 uv0;
  32. layout(location = 1) in vec3 tangentToWorldZ;
  33. layout(location = 2) in vec4 tangentToWorldX;
  34. layout(location = 0) out vec4[3] fragColor;
  35. void main()
  36. {
  37. GBufferData gbufferData;
  38. gbufferData.albedo = vec4(0.05f, 0.05f, 0.05f, 1.0f);
  39. gbufferData.worldNormal.xyz = tangentToWorldZ;
  40. encodeGBuffer(gbufferData, fragColor[1], fragColor[2]);
  41. // TODO - Just returning a simple ambient term, use better environment lighting later
  42. fragColor[0] = vec4(gbufferData.albedo.rgb, 1.0f);
  43. }
  44. };
  45. };
  46. };
  47. #include "$ENGINE$\Surface.bslinc"