Yue Posted June 17, 2023 Share Posted June 17, 2023 How can I make the surface of the flashlight where the light is projected shine? Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted June 17, 2023 Share Posted June 17, 2023 A bloom post effect maybe? Or if your talking about the lens of the light you'll need an emission material. 1 Quote Link to comment Share on other sites More sharing options...
Yue Posted June 17, 2023 Author Share Posted June 17, 2023 How do I create a broadcast material? How do I create an emission material? so that the lens looks shiny? Quote Link to comment Share on other sites More sharing options...
Solution SpiderPig Posted June 17, 2023 Solution Share Posted June 17, 2023 There's bloom.lua in the posteffects folder under the shaders folder in your project. I think you add that to your camera as a post effect. For an emission shader I think you just need to change the shader from diffuse.shader to emission.shader in the material editor. I haven't used Leadwerks in a while though. 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted June 17, 2023 Share Posted June 17, 2023 light:SetColor(2,2,2) 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...
havenphillip Posted June 17, 2023 Share Posted June 17, 2023 You want the scene to reflect on the helmet visor? 1 Quote Link to comment Share on other sites More sharing options...
Yue Posted June 17, 2023 Author Share Posted June 17, 2023 Yes, this works with an emissive material, so the idea is that it only works when the flashlight is on, I guess I have to change the material from the script. 1 Quote Link to comment Share on other sites More sharing options...
havenphillip Posted June 18, 2023 Share Posted June 18, 2023 Oh I see what you're doing. You could use a single material to do it. The thing that makes emission is really simple it's just the first three vectors of the specular output. You could set up an if statement in the shader something like this: uniform float light_on; .... if (light_on == 1.0) { fragData2 = vec4(1,1,0,1); } else { fragData2 = vec4(0,0,0,specular); } Then in your script somewhere you set the float and set it to the flashlight function. Something like: Script.flashlightOn == 0.0 ... self.shader:SetFloat("light_on",self.flashlightOn) function Script:UpdatePhysics() ... --Toggle the flash light on and off if window:KeyHit(Key.F) then if self.sound.flashlight~=nil then self.sound.flashlight:Play() end if self.flashlightOn == 0.0 then self.flashlightOn == 1.0 else self.flashlightOn == 0.0 end end 2 1 Quote 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.