Jump to content

Recommended Posts

Posted

If you are using a trigger based on collision, the effect is being added more than once to the camera post effect stack. You need to add a boolean check to prevent the effect from being added more than once.

 

example:

Script.rain = false

...

...

...

function Script:Change()

if self.rain==false then

self.rain = true

self.camera:AddPostEffect("Shaders/PostEffects/Rain.shader")

end

end

 

Edit - Same problem here: http://www.leadwerks.com/werkspace/topic/15421-clearposteffects-making-graphics-go-crazy/#entry103394

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

  • 3 weeks later...
Posted

Here is a try with inside rain collision, I made today:

 

 

Edit

To make this I just let about 200 or more box with Mass set to 1 with invisible material falling over the player in a randomized area: This will be used as shape for roof collision.

Attach a sprite /billboard with the rain Material. Then an emitter at collision()/position for water splatsch.

After colliding just put the same box over the player again and again.....

 

The problem I found is that after 10 minutes or more it will be "Error: Run out of lua memory"

I checked that the game RAM would be bigger and bigger with time.

 

The material applied to the sprite seems to be essential in this. Seems that using a alpha texture is unfortunately too expensive.

I used finally a very thin sprite with a default material shader Model/flat/default - Alpha setting + Z-sort. Seems to be the less expensive for best graphic results.

 

Edit:

Solved with collectgarbage() added in main()

Now it looks like this:

  • Like 1
  • Upvote 3

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...