Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
Question... "Burn" off Fog?
Post Flair (click to view more posts with a particular flair)
Post Body

Hey!

I have a shader that generates a very nice "fog" effect. I also have a number of 2D lights in my scene. I would like to be able to, in the fog shader, set a fragment alpha based on how close it is to a light source. The closer the source, the more transparent it becomes... simulating the light burning the fog away.

I noticed I can use light(){} in the fragment shader, but, as the name implies, it only effects the lighting of the fog. I cannot seem to affect the alpha of the fragment with the light(){} function. Conversely, there doesn't seem to be a way for me to obtain the light information from within the fragment(){} functions.

Again... this is for 2D, not 3D.

Is there something I'm missing, or is this just not possible with Godot at present?

Author
Account Strength
90%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,610
Link Karma
176
Comment Karma
1,434
Profile updated: 4 days ago
Posts updated: 2 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 years ago