PDA

View Full Version : Per Pixel Lighting question



jeppa
04-30-2002, 08:16 AM
i'm reading some paper about per-pixel lighting,and my question is it:is possible to
make per-pixel lighting with 2 texture(one 2D
Texture and other 1D Texture) whitout using the register combiners(nvidia cards)????

Thanks in advance

jwatte
04-30-2002, 08:40 AM
You need, at a minimum, the "dot3" bump mapping extension. The most basic per-pixel lighting model is then to create an object space normal map, and pass the global light direction in as a constant color. This gives you per-pixel diffuse brightness, on which you can later modulate in the base color map.

If you support articulated meshes, you have to pass one light vector per vertex, and you start needing some kinds of extensions to make it end up in the right spot, ideally after a normalize step.

If you want something more advanced, you'll have to build it on top of the more advanced extensions (nVIDIA vs ATI).

LordKronos
04-30-2002, 10:00 AM
We generally mean per-pixel lighting as "attenuation + bump map + specular + ....", but per-pixel lighting is technically any type of lighting that is calculated on a per-pixel basis rather than per-vertex interpolated. Jeppa, it sounds like what you are most interested in is simple distance attenuation. If so, you can do this on pretty much any card. Cass from nvidia made a demo of the technique. Look here: http://developer.nvidia.com/view.asp?IO=pp_attenuation_ogl

jeppa
04-30-2002, 11:20 AM
Thank for your reply Lordkronos.Yes I'm interesting at Diffuse-Specular attenuation

Thanks
Sandruzzo

jeppa
04-30-2002, 11:23 AM
Thank for your reply Lordkronos.Yes I'm interesting in Diffuse-Specular attenuation

Thanks
Sandruzzo

davepermen
04-30-2002, 01:26 PM
well.. there is no attentuation in this one in, but its quite much you can get into 2 textures http://www.opengl.org/discussion_boards/ubb/smile.gif http://tyrannen.starcraft3d.net/PerPixelLighting

but seriously, you _could_ do it with 2 textures, one is the normalmap, and the other one a

color normalized(vector v) {
float length = sqrt(v.dot(v));
return color(v/length,length);
}

3d texture..
now you can't use 3d-textures => no way http://www.opengl.org/discussion_boards/ubb/wink.gif

attentuation on gf2 _can_ be done with 1 texture, if mapped correctly (using primary color instead of a 1d texture http://www.opengl.org/discussion_boards/ubb/wink.gif)
normal can be done on a gf2 in another one texture..

but the point_to_light gets missed then most probably.. could think about it with some **** of paper... http://www.opengl.org/discussion_boards/ubb/smile.gif