Jump to content

fullbright surface?


Yue
 Share

Go to solution Solved by SpiderPig,

Recommended Posts

  • Solution

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.

  • Like 1
Link to comment
Share on other sites

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

 

 

 

 

 

 

  • Like 2
  • Upvote 1
Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...