How to make a multipass shader in 3D in Godot 3?

pauloyasupauloyasu Posts: 4Member

I need a multipass shader because I want to draw a plain color object and blur it and in the second pass I want to draw the object on top of it, so it appears to glow.

How do I do it? Or, is there any better way of doing a glow shader?

Answers

  • MegalomaniakMegalomaniak Posts: 774Admin
    edited December 2017

    HDR, bloom and emission element in the shader would produce glow.
    You can read more about the render pipeline here:
    https://godotengine.org/article/godot-3-renderer-design-explained

  • pauloyasupauloyasu Posts: 4Member
    edited December 2017

    I'll look into it. But, is there a way of making multipasses?

    Edit: I looked into it, and that's not what I want... I don't want a glow that glows over the image, but only surrounding it, like a outline.

  • TwistedTwiglegTwistedTwigleg Posts: 542Moderator

    There is a toon shader with an outline in the material testers demo on the Godot demo repository. Maybe it will help?

  • pauloyasupauloyasu Posts: 4Member

    I've seen it, but I can't see the code for that shader.

  • TwistedTwiglegTwistedTwigleg Posts: 542Moderator
    Answer ✓

    If I recall correctly (and it has been awhile) you can convert spatial materials to shader code, so maybe that will work?

    Another idea could be taking the toon shader from the material, change the first pass into a normal PBR setup, and then add emission to the outline pass. That way you could get a glowing outline without any code.

  • pauloyasupauloyasu Posts: 4Member

    @TwistedTwigleg said:
    If I recall correctly (and it has been awhile) you can convert spatial materials to shader code, so maybe that will work?

    That was exactly what I needed! Thanks!

    About making it without code, I want to learn how to code shaders, and I'm using godot shader language to get into it easily, so, I want the code! :D

Sign In or Register to comment.