Jump to content

  • Log In with Google      Sign In   
  • Create Account

Preventing Out-Door dust particles from entering inside buildings


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 Medo3337   Members   -  Reputation: 680

Like
0Likes
Like

Posted 21 December 2012 - 11:32 PM

Lets say we are in a dust weather, I use the particle engine to create some dust smoke out-door, however it's getting inside the buildings which is not realistic.

Same apply to rain and snow, of course you don't enter a building and see it's raining inside it.

How can I prevent the dust/rain/snow particles from getting inside buildings?

Sponsor:

#2 hupsilardee   Members   -  Reputation: 487

Like
0Likes
Like

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)



#3 Medo3337   Members   -  Reputation: 680

Like
0Likes
Like

Posted 22 December 2012 - 11:05 AM

@hupsilardee: I thought I could have a boundary box around each building, but I don't know how I can know if the particles are inside the box so I can discard it.

#4 Katie   Members   -  Reputation: 1374

Like
5Likes
Like

Posted 22 December 2012 - 12:47 PM

Cheat.

 

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...



#5 Khatharr   Crossbones+   -  Reputation: 3040

Like
0Likes
Like

Posted 22 December 2012 - 01:31 PM

Positive air pressure?

 

Sorry. Couldn't resist.


void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

#6 Medo3337   Members   -  Reputation: 680

Like
0Likes
Like

Posted 22 December 2012 - 03:57 PM

@Katie: That's interesting idea.

For the rain/snow, do you mean I will create bunches of boxes following the player position, when those boxes detect collision with the building, the boxes Y position change to be over the building?

For the the dust, if the player is looking from a window inside the building, the player should still see the dust, so I will not stop generating the dust particles when the player is inside the building, I want it to be generated outside the building so the player can see it from the building window or door, I'm talking about a dusty weather, I found a screenshot that will let you know what I'm trying to accomplish, see the screenshot:
http://shots.ikbis.com/image/20894/large/Bad_Weather-_Tripoli_2006.jpg

#7 Katie   Members   -  Reputation: 1374

Like
0Likes
Like

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.



#8 haegarr   Crossbones+   -  Reputation: 4588

Like
0Likes
Like

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.



#9 Medo3337   Members   -  Reputation: 680

Like
0Likes
Like

Posted 23 December 2012 - 01:23 PM

@Katie: That would be a little bit complicated especially if I'm working on a large mission, adding thousands of boxes in a level design just for rain/snow is a waste of time, I'm trying to implement a way that has nothing to do with level design so I can just enable/disable rain in the level design without having to create thousands or hundreds of boxes.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS