Jump to content

Billboard Tree Material Layering Wrong


blackmailchan

Recommended Posts

I have this issue with standard Unity terrain shading, CTS, and I bought GTS hoping it would help too- but to no avail.

 

My water from AQUAS which is on render queue 3001 perfectly works fine with everything else, but not with the billboard trees. I can't just use mesh trees because then I'm forced to deal with lower FPS.

 

I can't directly edit the Speed Tree billboard material, and I don't know how to change billboard trees on Unity to a different material entirely. I was hoping GTS would do that but it doesn't. Is there anything I can do to solve this issue of water rendering over billboard trees?

 

spacer.png

 

spacer.png

Link to comment
Share on other sites

A terrain shader won't be able to fix this issue - it looks related to both the billboards and the water you are using. It looks as though the billboards are being rendered first, then the water material is being rendered (possbily last as its render queue is quite is in the 3000 range) - but the water is overriding the depth value stored in the dpeth buffer at the time. 

 

It seems as if the billboard shader is not writing to the depth buffer (i.e. ZWrite off), or it is, but the value that gets written is quite far away (i.e. pixel is far away from the camera), but the object is not. Then, once the water shader needs to do its depth comparison (i.e. ZTest), the depth value written by the billboard shader is further away from the current depth of the water, so it overrides it. 

This type of fix would require access to the shaders / editing the billboard material to see what was going on.  

Link to comment
Share on other sites

11 hours ago, Isaac said:

A terrain shader won't be able to fix this issue - it looks related to both the billboards and the water you are using. It looks as though the billboards are being rendered first, then the water material is being rendered (possbily last as its render queue is quite is in the 3000 range) - but the water is overriding the depth value stored in the dpeth buffer at the time. 

 

It seems as if the billboard shader is not writing to the depth buffer (i.e. ZWrite off), or it is, but the value that gets written is quite far away (i.e. pixel is far away from the camera), but the object is not. Then, once the water shader needs to do its depth comparison (i.e. ZTest), the depth value written by the billboard shader is further away from the current depth of the water, so it overrides it. 

This type of fix would require access to the shaders / editing the billboard material to see what was going on.  

 

The billboard shader is built in- it's Unity's Speed Tree Billboard and as such it is not allowed to be edited. I think as a workaround I'm just going to have to make all trees into mesh and somehow figure out if I can reduce their draw calls.

Link to comment
Share on other sites

  • 1 year later...

Has this problem ever been fixed? I've always had the same problem: Gaia's water doesn't work well with billboard trees unless they're a certain kind (e.g. SpeedTree). The water has always rendered over my billboard trees, so that their tops will seem to float in the air wherever there's visible water.

The problem is apparently a conflict in the render queue: both billboard trees and Gaia water are set to the same layer (3,000).

The solution should be simple (AFAIK): just change the rendering queue for Gaia's water so that it's rendered *before* the tree billboards. It works perfectly when I've edited the render queue for Aquas (non-Gaia) water, but unfortunately it's not possible to change the rendering queue for Gaia's water. Is there a reason why the render queue isn't exposed/editable for water?

It's too bad, because Gaia's ocean water looks MUCH better than other solutions (no pun intended!).  But since I can't change the render queue for Unity's billboard trees, there's no way to resolve the conflict.

So, though I've got both Gaia and Gena Pro, I'm still stuck using an outside system for water. (My game takes place on an island, so the water is pretty important)

(I'd upload a screenshot, but apparently Dropbox and Drive links aren't allowed. I could upload it to one of my websites, but -- seriously -- why?  It's 2023, and this is an image-focused product -- why not allow images to be pasted or uploaded to the support discussions?)

Link to comment
Share on other sites

Hi @Bill Pomidor
 

Quote

Is there a reason why the render queue isn't exposed/editable for water?


it depends a bit on the render pipeline you are targeting: 
- In HDRP there is no render queue, and shaders created in shader graph do not expose one afaik
- In URP materials using a shader graph shader should expose the render queue by default
- In Built-In Gaia uses a custom material editor that does not expose the render queue - this has not been highlighted as a problem for us yet. Exposing it is just a line of code, can you please tell me which Gaia version you are using, then I can send you a patch & include this in the next Gaia update as well.

Regarding uploading screenshots: I do not know all the intricacies of Invision (the community software canopy runs on), but it should work to post links to images there. See e.g. this post here that has it. You should also be able to upload images to this board directly, either as attachment or via copy and pasting them into the written text. There is a size limit of 3MB per image for this.

Link to comment
Share on other sites

Many thanks for the super-fast (and super thorough) reply, Peter! 

I'm using Unity's built-in renderer, so I would very much appreciate a patch or script that allows me to change the render queue for Gaia's water material.  My current Unity editor version is 2023.1.1f1.  I couldn't find any Gaia version info (e.g. GaiaVersion.txt), but the Gaia Manager's header says it's "Gaia Pro (3.4.1-c5, Unity 2023.1.1f1)"

With regard to image upload/insertion or sharing links, I uploaded my image to Dropbox, set it to be accessible to anyone with the link, and then I pasted the link into the "Insert image from URL" button/field in the lower right corner of this text-entry box. Clicking "insert" changes the field to red and fails to insert the image or the URL.

<<You should also be able to upload images to this board directly, either as attachment or via copy and pasting them into the written text.>>

I see no buttons or controls for uploading, attaching, or copy-pasting images (or any files) into/onto this text-entry field. When I try to paste a copy of the image directly into the text, nothing happens. (My ad-blockers are off, btw)

Below, I've included the URL for the Dropbox file -- first as a simple cut-paste entry of the URL's text, and then by using the link button in the formatting toolset at the top of this text entry window.  Maybe the direct URL will work, but it's still a hassle to upload/link to an image to my own site rather than pasting the image into the text. (It also reduces the likelihood that the image will be viewed by other members, IMO)

Thanks again!

https://www.dropbox.com/scl/fi/xo0lddqehl8g95tncd8q4/Gaia-Water-Render-Queue-Conflict-with-Billboard-Trees.png?rlkey=3oqws4sml5zlg2wtemtkuiyjg&dl=0

https://www.dropbox.com/scl/fi/xo0lddqehl8g95tncd8q4/Gaia-Water-Render-Queue-Conflict-with-Billboard-Trees.png?rlkey=3oqws4sml5zlg2wtemtkuiyjg&dl=0

Link to comment
Share on other sites

Hi @Bill Pomidor,

please find attached a patch for adding the render queue on the Gaia Water Material:

Gaia2021WaterRenderQueueHotfix.zip

You can install the .unitypackage in the zip via Assets > Import Package > Custom Package... in the Unity Editor.

I reviewed the Canopy settings again and found one permission was missing from the Members role, for adding attachments - you should now be able to add attachments to the posts, and I believe this should fix the copy and pasting as well.

Link to comment
Share on other sites

Many thanks, Peter!  Adjusting the Render Queue solved the problem nicely.  😁

And just to clarify (for clueless folks like me who might waste time trying to run the patch directly or to attach it as a component!) -- the fix is almost TOO simple, lol!  If you want to use Peter's hotfix in order to edit Gaia water's render queue, simply import the (unzipped) unitypackage -- that's ALL!  Once the editor script is imported into your project, it'll allow you to see the Render Queue on any material that uses Gaia's PW_Water shader (i.e., the surface water's material).

If you're having problems with Gaia's water masking billboard trees, like I was, the hotfix allows you to fix it by dropping the water's position in the queue -- so that the water is drawn BEFORE the billboard trees (which means it'll be covered by the billboard trees, as it should be).  I'm pasting Before and After screenshots, just to demonstrate what's being fixed and how.

Thanks again, Peter!

 

 

Gaia Water Render Queue -- Default.png

Gaia Water -- Render Queue Value LOWERED.png

Link to comment
Share on other sites

  • 2 weeks later...

Just wanted to ask -- did y'all ever upload/apply/update Gaia to include the render queue fix (exposing the RQ setting so water could be dropped if in conflict with trees etc)?

Every time I update the runtime, I need to remember to change the RQ because it gets overwritten/reset to a higher value than my trees.

Even more exasperating: I added some Gaia content packages and inadvertently allowed the package manager to replace the patched version of the water material with the old version, so I'm downloading and replacing again.  I hope things get fixed/updated soon - thanks!

Link to comment
Share on other sites

AARRRGGGHHH

Apparently, the render-queue value also gets rewritten in play mode,  as well as any time the Runtime setup is refreshed.  

I had been prepping to demo the level tonight and everything was looking good -- -- except now, the billboard tree problem is just as bad as ever.  No alternative but to swap in the Aquas water instead, if I can find my prefabs and reload them.  Truly exasperating!

Link to comment
Share on other sites

Hi @Bill Pomidor,

in general we collect a few issues and fixes to publish them together to reduce the amount of new versions. I reviewed the problem with the queue resetting - it turns out that during the initialization of the scene the water shader is re-applied to the water surface, and unity does reset the render queue to what is set up in the shader then.
I've extended the patch to prevent this, please find an updated version here (this includes the change on the material  editor to expose the queue): 

Gaia2021WaterRenderQueueHotfixV2.zip

Please note that if you are setting up the runtime again in the scene, the default values for the material are taken from the ocean material prefab here:

image.png

You would need to adjust the render queue to the desired value here as well to avoid it overriding the material instance in your scene when you set up runtime again.

Link to comment
Share on other sites

Fantastic -- much appreciated!  Being able to keep the material values semi-permanent will be a big relief.  Don't get me wrong; I'm very glad that many of the Gaia presets are a little difficult to change -- they're so good, yet so potentially easy to screw up for someone like me who *always* overadjusts.  More than once, I've made changes to a scene over the course of many weeks, only to try re-baking with the default Gaia settings and find that mine had drifted way, way off course.

Thanks again!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...