Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with fog #4

Closed
swidku opened this issue Mar 28, 2017 · 7 comments
Closed

Doesn't work with fog #4

swidku opened this issue Mar 28, 2017 · 7 comments

Comments

@swidku
Copy link

swidku commented Mar 28, 2017

capture

You can see the Terrain and the tree on the left completely ignore unity fog.

@pavelkouril
Copy link
Owner

Hello,

shaders for unity terrain are a pain in the ass, to be honest.

I can check the fog issue if it does happen for normal meshes as well (probably does) - and if it affects any mesh and not just terrain, I'll fix it.

@swidku
Copy link
Author

swidku commented Mar 28, 2017

Yeah, it doesn't work on normal meshes too. You can see that poly tree on the left of my image using your shader completely ignoring the fog. To be honest I think the fog think is a global thing you'll need to implement to the shader and it would work on all objects including the terrain. I tried implementing it myself but I am terrible with shaders.

I was looking at this http://answers.unity3d.com/answers/1068485/view.html

@pavelkouril
Copy link
Owner

Try it now, should work correctly even with multiple lights. :)

I'm sorry I completly missed implementing the standard fog when doing this shader, probably because where I used the app, I used a post-process fog effect.

If you find any more bugs, please report them. I suspect there is something wrong with the specular higlight sometimes (they seemed kinda off), but I'm not completly sure; so if you find a reproducible case, just tell me about it. :)

@swidku
Copy link
Author

swidku commented Mar 28, 2017

Yep works perfectly. Thanks for the super quick help.

@mattconsto
Copy link
Contributor

I 'think' I might have found and issue with specular highlights: http://i.imgur.com/IaRVeON.gifv. In the GIF I'm changing the angle of the sun to simulate time changing, to provide a pseudo day/night cycle. The flickering is obviously not desired. If this is what you are looking for I could give you a copy of the terrain.

However, the flickering isn't really a big issue, it just shows that I should reduce the resolution of the terrain mesh. The bigger issue I'm having, and why I'm posting here is that as noted the shader doesn't support terrain fog as shown:

Switching to a the default shader fixes the fog.

@pavelkouril
Copy link
Owner

I'll try to reproduce it with the terrain and let you know. :)

Can you give more specific description of the setup, or even better, send me a small reproduction project to [email protected]?

@mattconsto
Copy link
Contributor

So I managed to get fog working with help from this link.

There's a a popping issue in the distance I need to fix, but once that's done I'll fork and submit a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants