-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
WebGPURenderer: Iridescence #26489
WebGPURenderer: Iridescence #26489
Conversation
// Force iridescenceIOR -> outsideIOR when thinFilmThickness -> 0.0 | ||
const iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); | ||
// Evaluate the cosTheta on the base layer (Snell law) | ||
const sinTheta2Sq = outsideIOR.div( iridescenceIOR ).pow2().mul( float( 1 ).sub( cosTheta1.pow2() ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use oneMinus
here and in similar places below.
const Ess = fab.x.add( fab.y ); | ||
const Ems = Ess.oneMinus(); | ||
|
||
const Favg = specularColor.add( specularColor.oneMinus().mul( 0.047619 ) ); // 1/21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just write this constant as 1/21 then? It will be converted into its decimal form in any case while building.
Related issue: #26486
Description
Added
iridescence
support forPhysical Lighting Model
.webgpu_loader_gltf_iridescence
exampleFixes