Jump to content
Posted 21 December 2012 - 11:32 PM
Posted 22 December 2012 - 04:22 AM
Use clipping planes corresponding to the outside walls of the building when you draw the particles. A pixel should be discarded if it lies on the wrong side for ALL the planes, (not just one)
Posted 22 December 2012 - 11:05 AM
Posted 22 December 2012 - 12:47 PM
It's always easier to cheat. You're trying to solve slightly the wrong problem; You're trying to figure out how to run a system where you make random rain and then work out how to not have it enter the buildings.
It's much easier to do this in your level design. Make it "rain" in boxes. The raindrops start at the top and fall down (you can do this in the vertex shaders fairly easily). When they get to the bottom of the box they get recycled at the top.
You plonk these down in your level... at ground level in the streets, at roof level over the buildings. You should also then be able to cull them fast -- if the view is indoors, it can't see up anyway, so the overhead rainboxes are never rendered. (You can get away with the rain sequence repeating as well. You can also get away with using the same rain positions for all the boxes... add some distance fogging and no-one will ever spot the rain tiling :-)
Likewise your dust -- it lives in boxes. The player moves through the box, dust is generated, it drifts back down.. job done. The dust is never made where there isn't a box -- like inside.
The goal of games development is to make something that's real enough that if the player co-operates with suspension of disbelief looks right. It doesn't actually have to solve all the annoying things for real if you can cheat...
Posted 22 December 2012 - 01:31 PM
Positive air pressure?
Sorry. Couldn't resist.
Posted 22 December 2012 - 03:57 PM
Posted 23 December 2012 - 09:30 AM
"bunches of boxes following the player position"
They don't need to move -- you just put them in (say) the streets between the buildings.
Posted 23 December 2012 - 09:38 AM
Another possibility is to not exclude the particles from the room but the room from where the particles flow. You have to destroy particles anyway, but it may be too complex to define the volume where particles are allowed to live. Hence you can move the rooms outside the (simple) box where the particles live, and use portals to virtually re-connect the rooms.
Posted 23 December 2012 - 01:23 PM