Since the RGBA components of materials and colors are not clipped to the positive range, I am wondering what kind of useful things you guys have found for negative values here … Just a thought … Anyone experimented with this before?
Originally posted by Iceman:
If I remember correclty when I started coding OpenGL some time ago, when I set the lighting colors to negative values it seemed as the lighting was done “inverse” that means the specular highlights were (1- specular color) and the diffuse light was black. But its to long ago to tell more details. Perhaps you can write a simple test app ?
I did that earlier. I observed that dropping the numbers below 0 had a noticable effect down to about -0.3 to -0.4. After that I noticed no difference. I did this for amb/dif/spec/emi material properties and noticed that if i dropped 2 of the channels way down and set the other (non-alpha) components to a positive value it seemed to add to the material glow.
I was wondering if anyone else had experimented with this and found some cool uses for it … hence the post.
If you (or anyone else) is interested, I can post the app on our website at work. It is GLUT based, and has a semi-crude interface. You select from Shininess/Amb/Dif/Spec/Emi by using the up and down arrow keys, you select from the subcomponents (R/G/B/A in the case of the reflectances) by using the left and right arrows, and add to or subtract from the selected component/subcomponent with the +/- keys. I displays a grid and several quadric objects. The sphere on the origin has the materials that are being interactively altered.
Can’t think of any cool effects, as the final vertex colours (post-lighting calculations) are clamped to (0,1) range before triangle interpolation…so where/why the ‘bump maps’ suggestion?!
Originally posted by knackered:
…so where/why the ‘bump maps’ …
Well it should be a joke because Iceman posted “bump”.I know that there is no correlation to bumpmapping.
3d-artists that don’t have the computational power to do global illumination sometimes fake indirect lighting by using negative lights that remove light instead of adding it. It can be a useful tool to add atmosphere to a scene or to fake soft shadows cheaply.
Nope, no relationship to bump mapping, this thread had sat for a day or two without a response so I ‘bumped’ it up to the top as a last ditch effort to see if anyone that may be interested had not seen it …
Anyhow … if anyone is interested in tinkering with the test app … I posted the executable here … (614Kb)
Here are the controls …
s - Stops the motion of the lights
F1 - toggles full screen
F12 - Screen shot to JPEG
You can change the five material properties of the center sphere … Shininess/Ambient/Diffuse/Specular/Emmissive. You select the property to be altered with the up and down arrows.
You can select the R, G, B, or A channels for the reflectances with the left and right arrows.
All properties are displayed on screen in text form also so you can see the negative numbers and their effects … Just a toy … enjoy …
[This message has been edited by Iceman (edited 08-13-2002).]