-
-
Notifications
You must be signed in to change notification settings - Fork 478
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
Enable Shader API does not function without changing underwater appearance #1145
Comments
These are two separate issues if you could kindly make a new one for one of the issues. |
I am not really sure which two separate issues you mean specifically of the various problems with the shader API mentioned. The primary issue is that the Shader API is non-functional any other information I have provided is for context. I can update the title to more accurately reflect the problem. |
There may be several distinct problems here, but I am not sure where the lines are or if they are all the same thing.
Do you want me to create 4 issues? I am fine if you break this up however you need to and I can sub to the other issues. |
Making a new issue for the artefacts should be enough. The other issues are tied to Depth Fog Density Factor? |
I have create this issue #1146
I don't think it is required, I did that to help illustrate the extreme difference in appearance. For my settings you can see far underwater so it is immediately apparent when enabled because it changes all the visuals of the underwater perspective and makes it harder to see the surface. I did confirm that without changing the setting is still occurs by examining the shader example in the example scene where it is masked as a sphere, you can zoom in on it and look around underwater and toggle the api and see the same visual changes, it is just much more apparent when you can see a bit further in the fog how much it affects everything. |
Thanks. It looks like the Depth Fog Density Factor and the portals feature currently do not work with the Shader API. I was unable to see any differences when either of these are not used. Does this sound correct? If it affects it without those features used, can you provide an example? |
Thanks. That should be all fixed now with latest. |
I will check it out. |
I am very perplexed by what I am seeing. I cannot seem to determine the cause of the lighting change. I went so far as to re-integrate with the crest project where the lighting change does not occur. As far as I can tell all the code is the same (with the exception of things that are changed that are not running in the demo scene, like 3rd party fog, even taking that out has no effect). It almost seems like there is something stuck somewhere. I can copy the entire scene to the working project and everything works fine without changes... I will try rebuilding Library. Demo scene in my project: |
Rebuilding the library has no effect on the lighting problem, however disabling the directional light in the scene and creating a new one completely eliminates the lighting problem. It is not clear to me why. Must be some sort of corruption, if it was corrupted it should not have worked when loaded into another project. If I duplicate the light in the scene it remains broken. Wonderful! I'm not really sure what to make of this, but I have seen this happen before with lights being corrupted somehow. Idk if that means I need to destroy mine and make a new set with the same settings and everything will work then. Some sort of bug. So the tile culling is the only thing that remains maybe. |
It seems that the act of changing the color of the light causes this issue. But only in this project... Does not occur in latest project, which is the same code as I mentioned early. Copying my entire crest directory into a clean unity project makes the problem vanish... something is doing something. |
It appears to be caused by the color space settings in the project, it works with Linear but not Gamma. Can support be added for Gamma? |
Latest has it fixed for gamma. The line issue is probably related to #1146 instead? |
Fix looks good! I will check it out more when I implement it later.
I think this is a separate issue as it occurs because a tile is missing, not from a horizon artifact of some sort. It happens with MSAA off and It is difficult to get a good look at what it is, but I am fairly certain it is some sort of tile gap Having said all that I don't see that in my project, only the example scene (which means I may see it later) Side note: |
I am still seeing an issue with shadows when shader api is on, you can recreate this in the main scene by adding a giant cube above the water or other object that should make the water dark. This is what appears to be causing shadow / lighting issues with previous images of the docks Some other thoughts on this, I may need to disable tiling culling or something to prevent transparent objects over the ocean from becoming visible when tiles are culled. When the tiles are culled it seems more like objects above the surface (clouds or smoke for example) become part of the ocean because they are no longer masked by the surface. Or be forced to hide such objects. |
I will look at the shadow one but fixing it requires recalculating the scattering term a second time which could be a bit of a performance hit. In regards to culling, please open new reports for separate issues to reduce noise in this one. And yeah that makes sense re disabling underwater culling. |
Is there an existing issue for this?
Have you checked the documentation to resolve your problem?
Current Behavior
Enable Shader API moves the command buffer to/from before/after forward alpha which enables transparent shaders to render after the fog. While this is desirable, it does not seem like it works with the rest of the features (the docs say this is in "Preview This feature is in preview and may change in the future.")
_camera.AddCommandBuffer(_enableShaderAPI ? CameraEvent.BeforeForwardAlpha : CameraEvent.AfterForwardAlpha, _underwaterEffectCommandBuffer);
I have been unable to use this feature because it alters the appearance of the surface / underwater rendering while in an ocean environment, not a mask / contained area with limited settings or short view distance.
Expected Behavior
Enabling the Shader API should not alter the appearance of the ocean shader, lighting, or create artifacts.
Steps To Reproduce
Off:
On:
Unity Version
2021.3.26
Crest Version
4.19
Render Pipeline
Built-In
Editor or Standalone
Editor (Edit Mode), Editor (Play Mode)
Environment
No response
Anything else?
You can sorta work around the API problem by using custom rendering for transparent shaders that have issues using the command buffer and not using the Enable Shader API feature. This does not always work though nor is it desirable.
The text was updated successfully, but these errors were encountered: