From 55f7b40d39ca3f25692ef6fdcee10dfb4b61e4a8 Mon Sep 17 00:00:00 2001 From: WestLangley Date: Thu, 30 Dec 2021 13:31:24 -0500 Subject: [PATCH] Clean up signatures --- .../transmission_pars_fragment.glsl.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js b/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js index cb3b4bfcdc7e6b..0b949e24d41e9c 100644 --- a/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +++ b/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js @@ -29,7 +29,7 @@ export default /* glsl */` varying vec3 vWorldPosition; - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { // Direction of refracted light. vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); @@ -45,7 +45,7 @@ export default /* glsl */` } - float applyIorToRoughness( float roughness, float ior ) { + float applyIorToRoughness( const in float roughness, const in float ior ) { // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and // an IOR of 1.5 results in the default amount of microfacet refraction. @@ -53,7 +53,7 @@ export default /* glsl */` } - vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) { + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); @@ -69,7 +69,7 @@ export default /* glsl */` } - vec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) { + vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { if ( attenuationDistance == 0.0 ) { @@ -87,9 +87,10 @@ export default /* glsl */` } - vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance ) { + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); vec3 refractedRayExit = position + transmissionRay;