0 votes

Hey everyone,

I would like to have an unlit constant color material that receives and casts shadows and also reacts to depth fog.

i gotta admit that i am kind of overwhelmed by shaders and i usually just copy paste stuff i find from the web.

For Unity i used a shader from this thread:
Link

By copy pasting some fog lines i managed to make it work with fog too.

Unfortunately im not sure how to do this in godot. Would like to use the WorldEnvironent depth fog but it only seems to work with shaded materials.

If anyone can point me into the right direction it would be much appreciated!

Skranker

Godot version 3.2.3
in Engine by (12 points)

1 Answer

0 votes

Does unlit means unshaded? Then all you need is to fake the "unshaded"
In this case, light shader is your friend
Basically, just multiply the albedo with attenuation, without any light calculation so it wont receive light

enter image description here

Anyway, you can make it even more unshaded by disabling the ambient light, but you might need to tweak the attenuation

enter image description here

For depth fog, not sure but maybe related to how Godot calculate it

by (21 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.