Archived

This topic is now archived and is closed to further replies.

stryx

Lighmap brightness and Quake 3 like problem

Recommended Posts

Hi, 1) I''m using Shadowmaps to put light into my scene. This results in very dark gfx. How to increase the Gamma ? I know Quake 3 uses something like gl...Ramp Stuff. I''ve no idea about it. 2) Quake 3 has a problem. The models are not shadowed in realtime. So in my scene my model has normal brightness because of no shadowmaps on it. The map has it so the model doesn''t look like it''s in the scene correctly. How can I calculate a shadowmap for the Model or increase the map brightness or decrease the model brightness ? or what would you do ? Thanks anyway, StryX

Share this post


Link to post
Share on other sites
SetDeviceGammaRamp.

be very carful with this call. VERY.

as for model lighting, the easy way is to cast a ray down, find the triangle it hits, and get the point on the lightmap of that triangle. interperalate, and bang. you have your lighting value.

Share this post


Link to post
Share on other sites
a follow up.
Q3 lightmaps are calculated for 4x overbrighting (correct me if I'm wrong) and Q3 defaults to 2x overbrighting... which means to get the exact same look, you will have to double the brightness of the map first, and double the gamma.

note that the gamma values you pass to SetDeciveGammaRamp are 16bit, not 8bit. so 255,255,255 is actually going to come out black. where 65k,65k,65k is white. Hence the ramp you pass must be an 3x256 array of unsigned shorts.
Ohh. and they are colour map values, not scalers.
so, for a normal ramp, the values go up by 256... starting at 0 for each of the 3 parts of the ramp (RGB)... go up by 512 for 2x overbrighting, etc.

Win XP also has systems in place to cap scales to 0.5 and about 3.5x. so you can't screw up with xp as badly as 98 or whatnot


[edited by - RipTorn on May 2, 2002 7:25:35 PM]

Share this post


Link to post
Share on other sites
Thanks,

The Projection of the lightmap thing is really cool.

Looks nice

GammaRamp, emm, I think I let this thing alone for now and come back later.

Thanks !

StryX

Share this post


Link to post
Share on other sites
Well, I''ve tried to get the LightmapTextureCoord but I couldn''t find out how to get it.

I have a line given with a vertex and the line straight down.

I intersect this line with the plane of my triangle to get the intersection point. What''s next ?

How do I interpolate the TexCoords to get the right texcoord ?

Thanks anyway,

StryX

Share this post


Link to post
Share on other sites