The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

moss (6) [Avatar] Offline
#1
Hi Dan,

In Java3D, have I overlooked a way to modify the diffuse shading of an object from Lambert to Phong?

I am trying to render an illuminated sphere such that its unilluminated side dimly stands out against a black background and a sharp terminator appears between the illuminated and unilluminated sides -- much like a crescent Moon appears. To this end, I have created a light source whose ambient component consists of a dimmed, white light ambient source (i.e., the color white used is scaled by a some fraction, e.g., 0.1) and a point, white light source. The sphere has an ambient component of a dark color (e.g., dark blue) and a diffuse
component of a bright color (e.g., yellow). Because of the diffuse reflectance drop-off near the terminator and the underlying ambient light, the separation of the two sides is blurred. I understand that specular reflectance is done via a Phong shading algorithm, but I am only interested in diffuse lighting.

One way I found to accomplish the above is to add multiple point light sources at the same place. This reduces the terminator blurring but causes the saturation and color washout of the rest of the illuminated side. (This brings up the question of "How does one clamp the resultant reflected light?".)

Any help is appreciated.

Thanks.

moss
dselman (104) [Avatar] Offline
#2
Re: Are There Alternates To Lambertian (Diffuse) Shading?
Moss,

Not sure I can help much. I haven't tried this. It may also be wise to check the effect on a few different cards as lighting it sometimes variable depending on drivers etc.

This is a very fun app:
http://sourceforge.net/projects/stellarium/

Dan