Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Doom Weaver II
20
Years of Service
User Offline
Joined: 11th Sep 2004
Location:
Posted: 30th Jan 2005 14:50
Is there a way to define the equation that determines how a normal is lit on a matrix?
I am trying to simulate water, and it needs to be lit differently at different angles.
Is this possible?
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 31st Jan 2005 06:41 Edited at: 31st Jan 2005 06:41
use this code.


Where:
MatNo is the matrix number
Detail is the X/Z tile amount

1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro (SP2)
Doom Weaver II
20
Years of Service
User Offline
Joined: 11th Sep 2004
Location:
Posted: 31st Jan 2005 13:15
Wow, I thought I had coded that myself, but it seems I got the normal angle wrong... damn! Thankyou so much. (Now i have to spend hours working out where I went wrong!)
But I'm afraid I need to rephrase the question... not only does it need to be lit differently at different angles, but it needs to be lit differently from a standard material (I suppose because water is perfectly smooth, and doesn't absorb light, or something like that).
I think (but i'm not sure) that the amount of reflected light from a light source, and therefore the brightness of the surface you see it reflected from, increase non-linearly as your angle from the normal approaches 90 degrees.
Like the way water shines in thin lines across its surface where its at a certain angle.
Does that make any sense?
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 1st Feb 2005 04:41
Don't know if you can change the way different matrices take light.

1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro (SP2)
Doom Weaver II
20
Years of Service
User Offline
Joined: 11th Sep 2004
Location:
Posted: 1st Feb 2005 15:36
yeah, I don't think its possible without shaders, and you can't apply them to matrices.
Shame, because the water looks bloody awsome.
Doom Weaver II
20
Years of Service
User Offline
Joined: 11th Sep 2004
Location:
Posted: 1st Feb 2005 15:40
check it out. I might try to code in C++ and give the equations directly to the video card.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2025-05-28 03:38:35
Your offset time is: 2025-05-28 03:38:35