#Canvas Item Shader Guide

44 messages · Page 1 of 1 (latest)

shut nebula
#

I want to use VHS shader in my Godot 3D horror game but the I don't know and can't find any tutorials on how to setup a canvas item shader

The shader is a canvas item shader and tells me to go and add a subviewport and add the shader but I don't understand how. My game is a 3D game and I had worked with spatial shaders before. Please help me to understand how to setup and use canvas item shaders on a 3d game.

brisk lava
#

what exactly do you mean by:

tells me to go and add a subviewport and add the shader

usually canvasitem shaders can shade any canvasitems, while spatial shaders are usually for 3d.

what exactly do you want to do? mind the X/Y problem, you don't just "want to use canvas item shaders", you want to achieve a certain result in your game.

shut nebula
#

Wait

#

Let me send you the shader

#

It is a canvas item shader can be used in 3d games

brisk lava
#

i mean sure, but also taking a step back and talking about why you want that shader would be helpful, because usually canvasitems and 3d are completely different things.

#

ooooh it's a postprocessing effect

shut nebula
#

But the problem is the way it's telling me to do I can't understand it

#

Yes post processing

#

The thing is I don't understand how to set it up

#

That's where I'm facing difficulties

brisk lava
#

ok, what are you facing difficulties with exactly?

#

Instructions:

1- Create a CanvasLayer node

2- Add a ColorRect to the CanvasLayer node

3- Click on the ColorRect -> Material -> New ShaderMaterial -> Shader -> Create New Shader -> Paste the code below

copied that from the shader page for reference

shut nebula
#

Can't find canvas item

#

Is that a node or the name?

brisk lava
#

nothing in the instructions mentions CanvasItem. but it's a node.

#

and so is CanvasLayer and ColorRect

shut nebula
#

Hmm

#

Okay

#

Let me try again with only canvas layer @brisk lava

brisk lava
#

the way i understand those instructions you want this scenetree:

[...whatever else your scene is]
CanvasLayer
  '- ColorRect

and that ColorRect then gets the shader and you'll have to make it full sized of course.

shut nebula
#

Hmm

#

It worked

brisk lava
#

yay!

shut nebula
#

So the problem was I was trying to find the canvas item node

#

Then I got confused with the subviewport container

#

Now I understand

brisk lava
#

i don't think you can actually make a canvasitem node

shut nebula
#

Thanks for helping

shut nebula
#

Well Thank you very much

brisk lava
#

yeah it's just the common parent of Node2D and Control, so that they can share the same 2d logic, it doesn't actually do anything as a node itself

brisk lava
shut nebula
#

Yeah

#

Now I understand

#

Thanks

brisk lava
#

like eg a screen in a 3d world showing some ui would be a subviewport of some kind

shut nebula
#

Yeah I saw a gui tutorial and got confused

#

I thought subviewport container was for this

brisk lava
#

nah that's to prevent your 2d stuff from just becoming an overlay, but for fullscreen shaders that's actually great that they are 😛