Lighting
Blitz3D Forums/Blitz3D Programming/Lighting
| ||
I have no idea what happened to my other post but here is my question. is there some way to use the lightmap that a level uses to color entities in my game depending on where they are? |
| ||
Yes. There's a pickedu / v function in the archives. Once you have them you can get the argb of the pixel on the lightmap texture by reading the pixel at u* texturewidth() and v* textureheight(). Convert this to r,g,b and use that as a basis to colour your entities. Stevie |
| ||
do you happen to know what it is called? if not thats fine |
| ||
Picked U/Picked V/Picked W command is here: http://www.blitzbasic.com/codearcs/codearcs.php?code=515 |
| ||
okay I have the code but it seems to only work for picking a object and getting it's texture. how would I use this for my entities if they are not pointing at the floor below them? |
| ||
Make a looooong scan-line.. from players hight to -10000000. This will make every a collision on the floor. With the getted texture color you're can calculate a black&white point wich meant to be used as object color (black color = shadow = black object) So long i known this makes the effect: Black & White = (Red + Green + Blue) / 3 |
| ||
I'm still a beginner with programing, could you explain it me again? |
| ||
I still need help I'm confused what Turtle was trying to tell me. |
| ||
Use the above mentioned source found in the archives. http://www.blitzbasic.com/codearcs/codearcs.php?code=515 You need to perform a line pick straight down from the entity that you want to color. Shadow Turtle was saying to make it a long pick, IE the distance goes way down on the Y from your entity. Use this pick and the function from that code to get the color value on the light map baked into your level. Use the entitycolor() command in blitz to set the color of the entity to whatever color value you retrieved from that function above. Keep looking around the forums, there was some demo source a long time ago that does just what you are asking and its commented very well. Good luck, Scott |
| ||
okay now I get it, thanks! |