Posted by E.Popov on March 06, 2000 at 11:11:54:
In reply to: Re: Range of intensity in TR3 (internal lighting) posted by R.Stone on March 05, 2000 at 20:35:40:
I tried again, this time on the scotdemo.tr2 level (TR3 lost artifact demo) - I have nothing else to test here (at work !). It's really dark with the range 0-32767, whereas with 8192-0 it's a little darker than with no internal lighting, but something really acceptable. So I must make a mistake. Here's the code:
TR1/2: fIntens = 1.0f - lpLstLighting[numvert] / 8192.0f
TR3: fIntens = lpLstLighting[numvert] / 32767.0f
lpLstLighting is a pointer on the bitu16 array of intensities. I use fIntens to multiply r,g,b values of the numvert vertex (r=g=b=1.0 if it's a textured poly / (r,g,b) color from the palette if it's a colored one). So, where is the bug ?
E.Popov