Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShaderChunk: Add opacity support to transmission shader #22196

Closed
wants to merge 1 commit into from

Conversation

mrdoob
Copy link
Owner

@mrdoob mrdoob commented Jul 27, 2021

Related issue: #22009 (comment)

Description

Screenshot 2021-07-27 at 17 27 24

/cc @elalish

@mrdoob mrdoob added this to the r131 milestone Jul 27, 2021
@mrdoob mrdoob marked this pull request as draft July 27, 2021 16:31
@takahirox
Copy link
Collaborator

Looking niiiice

normal, v, roughnessFactor, material.diffuseColor, material.specularColor,
pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,
attenuationColor, attenuationDistance );

totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor );
totalDiffuse = mix( totalDiffuse, transmissionFactor * transmission.rgb, transmissionFactor );
diffuseColor.a *= transmission.a;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a totalAlpha or totalOpacity... ?

@@ -20,11 +20,13 @@ export default /* glsl */`
vec3 v = normalize( cameraPosition - pos );
float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity );

vec3 transmission = transmissionFactor * getIBLVolumeRefraction(
vec4 transmission = getIBLVolumeRefraction(
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is transmission a good name for this variable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants