Coder Social home page Coder Social logo

Comments (6)

erichlof avatar erichlof commented on July 30, 2024 3

@q750831855
Hello again, I am happy to report that I have successfully added support for a roughness parameter on the HDRI_Environment demo! Check it out:
HDRI_Demo

Thank you for bringing this issue to my attention. Not only did I simply add a roughness slider to the demo, I fundamentally changed how the three.js path tracer handles different roughness settings so as to minimize those pesky fireflies (random bright pixels of when the a ray accidentally hits the sun, on top of a darker color material - very distracting).
So because you have inspired me to work on this feature, everyone benefits because I ended up having to improve the light transport for rough materials!

You should be able to learn how I added the roughness support in the matching .js and .glsl files for this HDRI demo. In your code editor, just search for the word 'rough' throughout my updated source code and it should show all the stuff I added to make this work. If you have any further questions, feel free to ask here on this issue.

Thanks again and enjoy!
-Erich

from three.js-pathtracing-renderer.

erichlof avatar erichlof commented on July 30, 2024 3

Hello @vinkovsky !

Sorry for the late reply. Yes it is possible to have the Damaged Helmet glTF model (with all of its PBR textures) placed in a scene with an HDR as the background and lighting.

Pretty soon, I might make a demo where you can load a couple of different glTF models with the GUI menu picker. Also, I would like the backgrounds to be able to change with another menu item picker, for maybe 5 different HDR background choices.

About the dynamic textures for models, now that is a little more tricky. It's not impossible (many professional rendering packages can dynamically change textures when you click on a part of the model with your mouse). But it would require a lot of supporting JS code, just for that one extra feature. Some type of material picking at the triangle level would need to happen, as well as a system to load in different textures on the fly, and then map them correctly to the model's UV coordinates.

Handling material and texture loading for 3D models is one of my weak areas of programming. I have mainly been focusing on how to correctly display and path trace the model and its different types of materials in the path tracing shader code, - after it has been already loaded. I have a pretty good grasp of the path tracing side of things, but not so much on the CPU JS loading and picking/replacing side of things for models and swappable materials. Sorry, hope this makes sense.

But thanks for the suggestions- I'll see about that HDR with the Animated BVH glTF model demo you requested. 🙂

from three.js-pathtracing-renderer.

RenderTool avatar RenderTool commented on July 30, 2024

https://neil3d.github.io/assets/pdf/s2013_pbs_epic_notes_v2.pdf

from three.js-pathtracing-renderer.

erichlof avatar erichlof commented on July 30, 2024

@q750831855
Hello, apologies for my late reply. Yes that code that you are using is sort of 'dead code' that was just lying around in the HDRI_Environment.js file. Although I do use it briefly when loading in the model data, it never actually gets sent to the GPU. The real data that gets sent to the GPU is linked with the GUI, which is Material type (either a 2,3, or 4 corresponding to metal, glass, or clear-coat plastic) and Material Color (which is three rgb floats, 0.0-1.0 range for each color channel).
I hadn't really set up this demo to be used with the roughness parameter - sorry for not clarifying that in the code comments somewhere.
I will try and add a roughness slider to the GUI panel, and then I will add a real roughness uniform that gets sent to the GPU so you can change and view the roughness results in real time.

Hope I have clarified why you were having the issue. I'll let you know when I have something working.
-Erich

from three.js-pathtracing-renderer.

vinkovsky avatar vinkovsky commented on July 30, 2024

Hello @erichlof! Is it possible to use the model with all the textures from the BVH_Animated_Model demo in the HDRI Environment demo?

from three.js-pathtracing-renderer.

vinkovsky avatar vinkovsky commented on July 30, 2024

It would also be nice to have a demo where you can dynamically change the textures on the models and change their intensity in a certain range.

from three.js-pathtracing-renderer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.