threepipe
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SSAOPlugin.patch.glsl 690B

1234567891011121314151617181920212223242526
  1. #ifndef USE_TRANSMISSION
  2. #if defined(SSAO_ENABLED) && SSAO_ENABLED > 0
  3. // note: depth can also be sampled and used when SSAO_PACKING = 1.
  4. // reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture
  5. float ambientOcclusion = tSSAOMapTexelToLinear ( texture2D( tSSAOMap, viewToScreen(vViewPosition.xyz).xy )).r; //todo: check encoding for tSSAOMap
  6. reflectedLight.indirectDiffuse *= ambientOcclusion;
  7. #if defined( USE_ENVMAP )
  8. float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
  9. reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
  10. #endif
  11. #else
  12. #include <aomap_fragment>
  13. #endif
  14. #endif