Multi Renders and Lights
Blitz3D Forums/Blitz3D Programming/Multi Renders and Lights
| ||
The questions are down below if u don't want to read this crap. Alil background: Ok i have few lighting questions. I ideas on how to get them to work but i figure since u guys have been playing around with blitz3d for ages and I, a few months, that u'll probably have decovered something by now. I know the hardware limitations is 8 max lights. Well, that even wouldn't be a problem if i had more control over them. The problem, u set a light, it becomes global..which is bad. U see, i'm just guess from what i've seen on professional games, that lighting is a function call and probably something that just happens once u set it when u're working directly with DX. Now there is software lighting, i've tested out many of them and they are all pretty slow. about 1 millisec to light a mesh with 300+ vertices isn't an option. One big reason is that i have about 50,000 polygons on my screen now in my engine( for those who read my first post on here, yes, i'm still working on it :-D). So now i'm working on tryin to get a local lighting system up, where there's probably a global directional light and then local spot and point lights everywere else on actors(not so much the map, that's what light mapping is for..something i'm working on). So now i'm thinking, hide entity might be an answer, then i reposition the lights and then render the entity. That'll probably work...if it wasn't for render order. I read from halo's engine that he has multi render system that helps up the FPS. But i think how i'm goin to make sure that when renderworld is called, that This entity might not overlap the entity infront of it. If i create my own Z order system, i figured that would just be to slow and that's the the hardware is for. Now i figured i might just have all other entitys around it become black during the render...then i might be able to use 2d draw commands to the back buffer with transparence on..again tho, now it's rendering extra crap and 2d commands are kinda slow :( ****Questions****** So now how do i make something multirender without worrying about improper Z order? Is there a decent way around blitz3d's global lighting system( like a function call...maybe someone can make a sweet DX7 DLL with the lighting call in it..:-D )? Is there a way to make a particular part of a texture uneffected by lighting wihtout using a new surface/mesh to overlay the orginal one effected by light? |
| ||
Yeah, multipass with a unique lighting environment is the way to go for characters, etc. |
| ||
Alright, how do u make sure i don't run into improper Z order? |
| ||
Just set CameraClsMode so it doesn't clear the z buffer (after the first pass). |
| ||
oh...thank you :-D. U really just helped out alot sir. I thank u for that. |
| ||
hey, how's your engine goin anyways? |
| ||
Attention everyone, I have bad news. halo's engine's plane crashed down over the English Channel an hour ago...no survivors. They're still looking for the black box. I'm sorry. |
| ||
I use OpenGL and BlitzPlus. It kicks ass. I will crush everyone. |
| ||
Only issue i'm having still is the Z buffer order. I turn it off and stuff just gets wild. The lighting idea is working tho, i have 100 ghost lights and 100 meshes. It relocates the light, changes the color and everything. I just can't get the Z order thing down yet. Halo, how did u get the entitys in the Z buffer if they are all hidden? |
| ||
Remember to reset the cameraclsmode when your doing the very first render, each loop, back it's default settings :) |
| ||
i tried that tho, i had renderworld as a Z buffer forcer. Then i set the cameraclsmode to false on color and z buffer. Basicly kinda like this Main Loop: { CameraclsMode Cam, 0, 1 REnderworld() ;every entity is hidden...the part i think i'm having issues with. But it's suppost to force objects into Z buffer... CameraclsMode Cam, 0,0 Loop each EntityObject shows ONE entity Basicly shows needed lights Positions and Colors lights Rendeworld() Hide Lights Hide Entity Next entity } end of Main Loop What's wrong exactly? The lighting is working, just the Z buffer isn't. |
| ||
haha, i got it...weird. I thought i tried that before. Thanks for all the help :-D |
| ||
so was the above correct then ? |
| ||
Yea, i thought i did that before tho. I program late tho, so sometimes i make stupid errors. It's working tho. I have 100 "lights" and one objects is alot to have 2 lights working on it at once right now. The light max is a variable tho. |
| ||
'I use OpenGL and BlitzPlus. It kicks ass. I will crush everyone. ' Jeez, who's been raiding the steroids cabinet? |
| ||
well, i hope he makes soemthing pretty good. I want to see some solid games come out of blitz, not just tech demos. Whatever it takes for him to make something sweet i guess. |
| ||
this all sounds really interesting... has anyone written a demo to show off this technology? if so... could someone direct me? |
| ||
u think i should but it in the code archives? |
| ||
yes, I think that would be great :) it would be very helpful |
| ||
There u go sir http://blitzbasic.com/codearcs/codearcs.php?code=1246 |