-
Notifications
You must be signed in to change notification settings - Fork 68
Material opacity #60
Comments
The renderer currently treats any material with I know this behavior diverges from Three.js, because in Three.js, With the limitation that the renderer only supports fully opaque and glass materials, how would you expect |
I have not checked how the ray tracing shader works but the rasterized output is quite simple with the last value of the vec4 controlling the transparency. Also I am curious that if the material goes fully transparent why does it have that black pattern ? I crossed checked again and removed all other maps except color and set the following material property :
Still I get the same output ? Is there a way to leverage this to include opacity in your ray-tracer ? Your input would be appreciated . Thanks :) |
Unfortunately no. Opacity, like how it works in Three.js, isn't supported in the renderer at the moment. The
So your table material looks dark because it's behaving like glass. That's because you're setting the const materialTableTop = new THREE.MeshStandardMaterial({
opacity : 1, // this property is ignored
transparent : true, // this is what's making your table look like glass
}); If you want your table to look like it does in the WebGLRenderer, set |
Thanks for your input! How difficult would it be to introduce say a transmissive material in your ray tracer with a control over transparency? Any papers you can point out to ? I would try to contribute to this project. |
Adding a new material type would be easy, but how difficult it is to model that material depends on the material definition. Would the material scatter the transmitted light diffusely, or would it just pass through without a change in direction?
pbrt implements a few transmissive materials. It's not discussed in the book itself, but it is implemented in the code. I can't remember which material it is, so you'd have to look around.
Absolutely! The PR I'm working on right now cleans up the material code a bit, so it might be more obvious how to proceed once I get that in over the next 2 weeks. But in the meantime, I can try answering your questions when they come up. |
When we ray trace an object which is set to transparent but whose opacity level is set to 1, the raytracer overwrites the opacity value with its own value. In the below image the opacity of the table is set to 1. This opacity value changes as the material is ray traced.
Realtime WebGL2 render:
Raytraced version:
You can see that the floor below the table is visible. The other issue you might be seeing is the texture repetition issue raised here:
#59
Thanks!
The text was updated successfully, but these errors were encountered: