Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
complex light and shading question (2.25D)
#1
Suppose that you have an Xmax, Ymax map of some object. Each point is (0 to 255). This represents height. 0 = lowest, 255 = highest.

Now, suppose there's a plane of light (or perhaps more...) that is adjacent to this map. The plane of light is at angle A1 to the map. The planes is tilted, like this:

Code:
/
/_

...and that would be angle A2.

Now, given the height map, with Xmax and Ymax, angle A1, and angle A2, how would one go about creating a light map?

The light map would have the same range as the height map, except that 0 represents total darkness and 255 represents direct light coming from the plane.

Assume that there is some sort of refraction R (0 to 255) for all points on the map. (For extra smileys, assume there is an Xmax, Ymax refraction map)

The refraction value is multiplied by all points where light has hit (thus there are new rays from that point)

Refraction stops when the light of that particular point is at a threshold T (0 to 255).

:|
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#2
So...

What's the question?
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
how would one go about creating a light map?
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#4
I don't know much about this, but I think you have to obtain the value just using scalar product.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#5
:|
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#6
Quote:how would one go about creating a light map?

Normals. ;*)
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#7
Code:
Normals. ;*)

Blarg. I suck at 3d math.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)