Would this help make a unlit shader?

About Monkey 2 Forums General Programming Discussion Would this help make a unlit shader?

This topic contains 7 replies, has 4 voices, and was last updated by  Ethernaut 8 months, 2 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #12196

    EdzUp
    Participant

    I want to make it for a game I’m working on.

    I borrowed this from the Unity website

    #12197

    EdzUp
    Participant

    probably nearer to the shader, also borrowed from the Unity forum

    #12239

    cocon
    Participant

    This shader is from some old code where I was learning about GLSL with OpenTK, it renders flat textures.

     

    #12265

    EdzUp
    Participant

    Thanks cocon im just looking at unlit textures but to be honest Shaders arent my thing, im used to EntityFX and TextureFX but now it all seems to be shaders for everything :/

    #12266

    Simon Armstrong
    Participant

    What exactly are you trying to achieve?

    If you don’t want lighting on a surface can you just zero diffuse and specular?

    #12268

    EdzUp
    Participant

    I’m not upto speed on diffuse and specular would this basically be just putting black textures in the PBR directory for the specular and diffuse files?

    #12662

    Ethernaut
    Participant

    The name “unlit” is a little misleading!

    It actually means that the texture is displayed at 100% of its original values, without any lighting applied (hence “unlit”), not that it’s 100% dark.

    Those shaders tend to be super fast, are are super useful for stylized looks where all your shading/detail is built into the texture, like a “cartoon shader” minus the lighting.

    Rendering a pure texture through the shader in Mojo is super easy for a 2D surface, but I still couldn’t get any custom shader to actually work with the 3D renderer… the Unity shader doesn’t really help in this case, but thanks! 🙂

    Cheers!

    #12663

    Ethernaut
    Participant

    You can get an unlit look with the PbrShader by:

    – Turning off the EnvTexture (i.e. “_scene.EnvColor = Color.Black”, this will create a black texture for the environment )

    – Setting the ambient light to Color.White (“_scene.AmbientLight = Color.White”)

    – Making sure the material has 0 Metalness and 1.0 roughness, if you want no specular hilights.

    – Don’t add any lights.

    This will look like an unlit shader, but it won’t render as fast as one! 😉

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.