Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_material.glsl
| Context not available. | |||||
| result.ssr_id = int(ssr_id); | result.ssr_id = int(ssr_id); | ||||
| } | } | ||||
| void node_shadertorgb(Closure cl, out vec4 outcol, out float outalpha) | |||||
| { | |||||
| vec3 V = cameraVec; | |||||
| vec3 vN = normal_decode(cl.ssr_normal, viewCameraVec); | |||||
| vec3 N = transform_direction(ViewMatrixInverse, vN); | |||||
| float roughness = cl.ssr_data.a; | |||||
| float roughnessSquared = max(1e-3, roughness * roughness); | |||||
| vec4 spec_accum = vec4(0.0); | |||||
| if (ssrToggle && cl.ssr_id == outputSsrId) { | |||||
| fallback_cubemap(N, V, worldPosition, viewPosition, roughness, roughnessSquared, spec_accum); | |||||
| } | |||||
| outcol = vec4((spec_accum.rgb * cl.ssr_data.rgb) + cl.radiance, 1.0); | |||||
| outalpha = cl.opacity; | |||||
| } | |||||
| #endif /* VOLUMETRICS */ | #endif /* VOLUMETRICS */ | ||||
| Context not available. | |||||