chicolitto Posted October 20, 2014 Share Posted October 20, 2014 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 Quote Link to comment Share on other sites More sharing options...
Rick Posted October 20, 2014 Share Posted October 20, 2014 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 Quote Link to comment Share on other sites More sharing options...
chicolitto Posted October 20, 2014 Author Share Posted October 20, 2014 Great. Thanks the 2 greatest adventage of leadwerks is the price and the community Lionel Quote Link to comment Share on other sites More sharing options...
Imchasinyou Posted October 20, 2014 Share Posted October 20, 2014 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 Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Josh Posted October 20, 2014 Share Posted October 20, 2014 Simple but cool effect: http://steamcommunity.com/sharedfiles/filedetails/?id=312811332 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
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.