deferred-fs.chunk 864 B

123456789101112131415161718192021222324
  1. layout(location = 0) out vec4 albedoOut;
  2. layout(location = 1) out vec4 emissiveOut;
  3. layout(location = 2) out vec4 normalOut;
  4. void main () {
  5. // Surface
  6. SurfacesMaterialData surfaceData;
  7. CCSurfacesFragmentGetMaterialData(surfaceData);
  8. // location of subpass output should be ordered by name.
  9. albedoOut = CCSurfacesDeferredOutputBaseColor(surfaceData);
  10. normalOut = CCSurfacesDeferredOutputNormalMR(surfaceData);
  11. emissiveOut = CCSurfacesDeferredOutputEmissiveAO(surfaceData);
  12. // Debug view
  13. #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_SINGLE && CC_SURFACES_ENABLE_DEBUG_VIEW
  14. vec4 debugColor = vec4(0.0, 0.0, 0.0, 1.0);
  15. CCSurfacesDebugViewMeshData(debugColor);
  16. CCSurfacesDebugViewSurfaceData(debugColor, surfaceData);
  17. if (IS_DEBUG_VIEW_ENABLE_WITH_CAMERA) {
  18. albedoOut = debugColor;
  19. }
  20. #endif
  21. }