Giter Site home page Giter Site logo

Comments (4)

pezcode avatar pezcode commented on July 28, 2024 1

The lack of diffuse (ie. subsurface) reflection is one of the defining characteristics of a metal. Its entire BRDF is just specular reflection. When you only have point lights in your scene, this will result in black everywhere except where light is reflected directly into the camera.

Compare with the glTF Sample Viewer when turning off Image Based lighting:

firefox_2022-11-03_18-47-08

The math should more or less match the glTF sample implementation. The code here modulates the diffuse color by the IOR, I'm not sure if that's actually correct (the glTF sample doesn't do that), but the difference should be minimal.

from cluster.

clibequilibrium avatar clibequilibrium commented on July 28, 2024

The lack of diffuse (ie. subsurface) reflection is one of the defining characteristics of a metal. Its entire BRDF is just specular reflection. When you only have point lights in your scene, this will result in black everywhere except where light is reflected directly into the camera.

Compare with the glTF Sample Viewer when turning off Image Based lighting:

firefox_2022-11-03_18-47-08

The math should more or less match the glTF sample implementation. The code here modulates the diffuse color by the IOR, I'm not sure if that's actually correct (the glTF sample doesn't do that), but the difference should be minimal.

Thank you for your quick reply. Indeed that would make sense when there are only point lights however same occurs on sky light branch under different angles. I think it would only be lit if the light is directed from bottom to top of the map ?

image

from cluster.

pezcode avatar pezcode commented on July 28, 2024

Yeah, directional lights suffer from the same problem. In real life, you have light coming in from all directions because of global illumination. The glTF sample viewer approximates that with Image Based Lighting. That way every incoming camera angle ends up reflecting into the skybox (I'm being very loose here with terminology).

from cluster.

clibequilibrium avatar clibequilibrium commented on July 28, 2024

Yeah, directional lights suffer from the same problem. In real life, you have light coming in from all directions because of global illumination. The glTF sample viewer approximates that with Image Based Lighting. That way every incoming camera angle ends up reflecting into the skybox (I'm being very loose here with terminology).

Lovely thank you so much for explaining and reasoning. So to solve it I can try to implement IBL or add GI which would be outside of this repository scope . Take care @pezcode !

from cluster.

Related Issues (10)

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.