Christian is correct regarding how physically-based ray tracers work with a BRDF. This distribution function is also sometimes lumped with sub surface scattering and transmittance, and called a BSSDF.
I think if we really want to make this physically accurate, we're going to need to find some method of allowing users to define this distribution function. I'm not sure trying to derive it from the shaders is the best idea. Instead, what we might be able to do is define a new file format in XML that can be used to describe the BRDF if photon mapping is used. Thoughts? -Scott -----Original Message----- From: Christian Van Brussel <[email protected]> Date: Fri, 18 Jun 2010 15:25:20 To: CS developers and users list<[email protected]> Subject: Re: [CsMain] Reflectivity of a surface On Fri, 2010-06-18 at 17:01 +0530, Mohit Taneja wrote: > Infact the reflectivity of the surface is also required while > scattering the photon, if the surface has high reflectivity, we should > have specular reflection for most of the photons and if the surface > has lower reflectivity, we should have diffuse reflection for majority > of photons. As of now the photons are reflected using diffuse > reflection (lambert's law). The way the light scatters through a material is described by what's called the "bidirectional scattering distribution function" (BSDF, see http://en.wikipedia.org/wiki/BSDF). This is the mathematical formula describing how the light is reflected, scattered inside the material (sub-surface scattering) and transmitted through it. Unfortunately, in the context of a real-time rendering engine such as CS, the BSDF is managed mostly by the shaders, and there are no way to know what a shader will do exactly, except by running it or looking at its code. However, many shaders are based on the Phong model (see http://en.wikipedia.org/wiki/Phong_shading) which approximates rather well opaque materials. It decomposes the reflection in a diffuse component for rough surfaces (ie where the light is scattered in all directions. AKA Albedo), and a specular component for shiny surfaces (ie where the light is bumped at the same angle that it was coming). In your case, maybe you can look if the material of the mesh has diffuse and/or a specular map, and use them to approximate what you need. Maybe you can also use the normal map (if any) to know the normal of the object. For sub-surface scattering and transmittance, this is more difficult. I don't know if there are already some shaders doing that and if there are some parameters that can be used. This however would still work only for 'common' shaders, and it is much harder to predict the behavior of more complex shaders without running the whole rendering pipeline. Geometry shaders are also another example of shaders that will mess all things a lot. So for now, maybe you can simply use the diffuse, specular and normal maps if provided, otherwise use default values? The diffuse map would affect the light scattered in all directions, the map specular would affect the light bumped at the same angle, and the normal map would affect the normal of the surface? ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Crystal-main mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crystal-main Unsubscribe: mailto:[email protected]?subject=unsubscribe ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Crystal-main mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crystal-main Unsubscribe: mailto:[email protected]?subject=unsubscribe
