ray-tracing-renderer
ray-tracing-renderer copied to clipboard
GBuffer/zbuffer/material in bitmap/array format
I guess it must exist, but I can't get my hands on it. Is there a gbuffer, zbuffer, material buffer in bitmap / array somewhere? I may have searched poorly? Thanks.
Are you asking in regards to adding user-defined IOR support? If so, here are probably the most relevant files:
- The material buffer is implemented as a uniform buffer object: https://github.com/hoverinc/ray-tracing-renderer/blob/master/src/renderer/glsl/chunks/materialBuffer.glsl
- You can upload data to it here https://github.com/hoverinc/ray-tracing-renderer/blob/master/src/renderer/MaterialBuffer.js
- And the IOR should be set on the SurfaceInteraction struct from the material buffer here: https://github.com/hoverinc/ray-tracing-renderer/blob/master/src/renderer/glsl/chunks/surfaceInteractionDirect.glsl (for primary intersections) and https://github.com/hoverinc/ray-tracing-renderer/blob/master/src/renderer/glsl/chunks/intersect.glsl (for secondary intersections)
- Which finally can transmit light accordingly here https://github.com/hoverinc/ray-tracing-renderer/blob/master/src/renderer/glsl/chunks/sampleGlassSpecular.glsl
Sorry, it's a pretty complex change so that might be confusing. I can try to help out if you have questions.
Thank you very much, I looked a little, and I'm starting to understand some stuff. However, I was talking about zbuffers gbuffers. Bitmaps which store the depth information, material identifier on each pixel ... To make masks and postprod retouching