PDA

View Full Version : snapshot of my problem with textures

mithun_daa
11-30-2003, 11:28 AM
i have a problem using my 1D texture as a color scale. i have used the code provided in the red book. u can follow the link below to c the problem at the bottom of the webpage. i have rotated the terrain by 90 across the x axis, making the z axis the height. could anyone tell me what is wrong with it. this is the first time i m using 1D textures as colorscales.
www.geocities.com/mithunp4u/ (http://www.geocities.com/mithunp4u/)

thank u.

mithun_daa
12-01-2003, 06:05 AM
could someone tell me if im on the right track. plzzzz

zeckensack
12-01-2003, 07:35 AM
What's your range in z? If your terrain vertices have z between 0 and 50, the texgen will repeat the 1D texture 50 times over the full height. To correct this example, you'd set the third 'coefficient' to 1.0f/50.

Btw, use a mipmap filter for the 1D texture. Looks scary ...

mithun_daa
12-02-2003, 10:55 AM
Originally posted by zeckensack:
What's your range in z? If your terrain vertices have z between 0 and 50, the texgen will repeat the 1D texture 50 times over the full height. To correct this example, you'd set the third 'coefficient' to 1.0f/50.

Btw, use a mipmap filter for the 1D texture. Looks scary ...

what if my z values range from 1681 to 2281? do i just take the difference and set it as 1.0/difference ?
the values of z are 1681 and 2281 before translation.

[This message has been edited by mithun_daa (edited 12-02-2003).]

dorbie
12-02-2003, 11:48 AM
That would work but you then also need to set the base, and you use the fourth coefficient for that. So I think the fourth coefficient needs to be set to the base * third coefficient (or is it base/3rd coefficient?), anyhoo, something like that will get you there.

[This message has been edited by dorbie (edited 12-02-2003).]

mithun_daa
12-02-2003, 11:56 AM
Originally posted by dorbie:
That would work but you then also need to set the base, and you use the fourth coefficient for that. So I think the fourth coefficient needs to be set to the base * third coefficient (or is it base/3rd coefficient?), anyhoo, something like that will get you there.

thanx a millionnnnnnnnnnn. it works. and 4 the records its base * third coeff.
thanx a loot

[This message has been edited by dorbie (edited 12-02-2003).]