PDA

View Full Version : [solved]White out a scene? Disable lighting, etc?



Z-Knight
10-15-2008, 08:57 AM
How do I force the scene to have no colors, lighting, etc so that I still have a background color and the objects in the scene don't have any lighting (or even colors, except maybe for white)?

So in this case you won't be able to see the sides, edges of objects ... and yes, I realize that many times people have this "problem" and want to do the opposite of what I'm trying and be able to get lighting, colors, etc to work.

I know I can disable lighting, etc, but that doesn't seem to be working...especially if the objects I'm calling have their own glEnable() calls for lighting, etc...how do I force all future enable calls to not work, is that possible?


Basically I want to get picture (A) in this link:
http://www.naturewizard.com/tutorial0107.html

http://www.naturewizard.com/Tutorials/Tutorial01/images/image013.jpg

_NK47
10-15-2008, 09:18 AM
not possible if other calls change the states by themselfes. basically you say you disable lighting, texturing and so on and next call we set them again. no solution other that providing a special OpenGL32.dll which forces those values to stay constant.
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/files.html

Z-Knight
10-15-2008, 10:29 AM
ok, so I can't force a permanent disable...ok I can deal with that with some changes to my code.

but if I do disable, lighting, texture, etc I should see scene (A) right? I swear I'm doing that and I still get some damn partial lighting and I can't seem to track it down. I tried just calling glDisable() on the lighting, materials, textures, etc but maybe I missed something...or it could be how I'm rendering my object that's causing the problem...sigh, ok back to searching.

thanks.

dletozeun
10-15-2008, 10:39 AM
I am not sure to understand what you are trying to do but, you can use glsl shaders to have a complete control on lighting.

Z-Knight
10-15-2008, 11:04 AM
Basically I am wanting to force an object to be one color in the scene...ie one solid color. I'm using this in my code to calculate the cross-sectional area of the object in the view. I was using FBOs to draw to the render buffer and only had the background and the object drawn and I would calculate the number of background pixels there were to figure out how many object pixels exist...well, by forcing the object to be one color (white) and the background any other color (say black) then calculations are easy...but if the object was drawn with lighting then edges on it could potentially be black or dark because of the light hit them and so I was trying to force a white out...for a lack of better words.

It turns out that my Object Oriented design caught me...I had been disabling texture, lighting, material (or so I thought) but it was not flowing down to the actual render method that was a couple of levels deep and once I fixed it I got it working.

So now, it is fine...by not having lighting, etc I just have a nice solid colored white object and the scene background is what I choose and I can do my calculations for cross-sectional area in peace.

Thank you very much.

_NK47
10-16-2008, 03:51 AM
dletozeun: ... you can use glsl shaders to have a complete control on lighting.

true. havent thought, sounded alot like fixed-function problem.