Home Technical Talk

Theoretical material discussion

Gestalt
polycounter lvl 11
Offline / Send Message
Gestalt polycounter lvl 11
I would like to discuss and gain a better understanding of the logic behind materials, no programming, just theory.

One of the key reasons for me bringing this up is because, from my understanding, there are just about no real materials that have Lambert shading. Also real materials obey the conservation of energy law, which often seems to be overlooked.

So from my understanding of when an object is lit, some of the light bounces off of the surface as specular and some bounces around in the surface and is partially absorbed by the material, giving it its color. So when there is a linear diffuse texture/color, multiplying that by the light describes the light being absorbed and the resulting diffuse. So what the diffuse texture really describes here is the percent of light that the material absorbs/does not absorb.

The diffuse itself has a material specific falloff based on the molecular structure and roughness of the surface.

The diffuse and the specular are added together as percentages of the light. So if I multiply my specular by .3 I should multiply my diffuse by .7 before adding them both together.

The ratio of the specular (reflected light) and diffuse (scattered light) changes with the angle between the light source and the camera, and that ratio depends on the material and its molecular structure.

As far as some ideas, I think it would make sense to base all lighting for an object (its diffuse lighting, its fresnel and specular reflections) on the "image" of the environment, so something like an ambient cube map for the diffuse and an environment cube map for all specular and reflections.

If I have anything wrong here or if there is anything that could be expanded more, please say so. If there are any properties that a material should have that aren't considered here please add them and how they would factor into things.

Replies

  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    You're essentially correct in your points.

    The lambertian diffuse model is no where near physically correct.

    Most often this is because our output environment, the screen, has a limted luminance output, far less than your average artificially lit environment, and many orders of magnitude lower than direct sunlight.

    The virtual lighting within the 3d environment is often limited in a similar way, from off (0) to full bright (1). We're getting better lighting tech all the time. now with floating point intensity lights and screenbuffers, and tonemapping to keep the scene's output within the display device's gamut, but we're still approximating things for aesthetic concerns, and computational speed. Physical accuracy hasn't been a concern, visual accuracy, or rather, visual acceptance, has been, and continues to be.

    In real life, the reflected light from an object is never 100% of the incoming energy, regardless of how much is reflected or re-emitted. Much is either absorbed or converted to other wavelengths, such as heat, which do not figure in cisually.

    Using cube maps for lighting works fine. It can give very nice results as well as its a sort of "radiance capture" of the scene. But again this comes to a technological bottleneck. Ideally each object would need its own radiance map, updated every frame, and stored in some format that preserved overall luminance. This gets very expensive very quickly.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    I think you're right about your thoughts as well.

    You could probably apply the same conserving thinking when using your Cube Map as well. If you use your Cube Map for both ambient lighting and reflections you could use similar ratio thinking on them as well, since they represent similar things as the diffuse/specular. If your object is highly reflective you won't apply as much ambient factor, and vice versa.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
  • SimonT
    Options
    Offline / Send Message
    SimonT interpolator
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    Some very helpful links and pdfs. Thanks! I'd be interested to know how people take these ideas and apply them in something like UDK. Right now I'm trying to think of ways to account for the range of different materials using a master material and material instances. If anyone has tried something similar it would be great to know.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Gestalt wrote: »
    Some very helpful links and pdfs. Thanks! I'd be interested to know how people take these ideas and apply them in something like UDK. Right now I'm trying to think of ways to account for the range of different materials using a master material and material instances. If anyone has tried something similar it would be great to know.

    Don't get obsessed with making one master material that does everything. In my experience it's just too much hassle most of the time. It's good to instance materials but you can usually get better results just by making a few different master materials that do different things.
Sign In or Register to comment.