Jump to content
chicolitto

Making a realistic living fire lightning effect

Recommended Posts

Hello all,

 

I started the developpement of my game and I thinking about my torches.

 

I've a particles emitter for my fire and a point light on it... great but a bit dead for a fire light.

 

 

Can someone tell me how to do realistic living fire lightning effect ?

 

 

Should I code a script to randomly change the brightness of the light ? or is there a more performance-friend solution ?

 

 

Thanks a lot

 

 

Lionel

Share this post


Link to post

Here is the script I attach to the lights to flicker. Just copied it from the old LE 2 firepit.

 

function Script:Start()
self.color = self.entity:GetColor()
self.fluctuation = 1.0
self.smoothedFluctuation = 1.0
end

function Script:Draw()
self.fluctuation = self.fluctuation + Math:Random(-100, 100) / 500.0 * Time:GetSpeed()
self.fluctuation = Math:Min(1.8, self.fluctuation)
self.fluctuation = Math:Max(0.75, self.fluctuation)
self.smoothedFluctuation = Math:Curve(self.fluctuation, self.smoothedFluctuation, 5.0 / Time:GetSpeed())

self.entity:SetColor(1.0 * self.smoothedFluctuation, 0.6 * self.smoothedFluctuation, 0.25 * self.smoothedFluctuation, 1)
end

Share this post


Link to post

I made a fire and then attached a light to it and used the script that makes the light randomly flicker. Looks awesome but then again I cant script so. . . . . Thats how I do it!

 

Here are my prefabs that might work for you. If not, then maybe some one else can use them. Free for all. Not that its some great ting here but I believe in helping and sharing when and where I can!

 

https://www.dropbox.com/sh/7a7klomo75wprx0/AAADdm6BIDJ9b3HOr48p224xa?dl=0

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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