Jump to content

Shader include errors


aldaluin
Go to solution Solved by aldaluin,

Recommended Posts

I'm trying to move a handful of Gaia-generated scenes from one project to another.  Both are using the same version of Unity (2020.3.37.f1) and Gaia 2021 Pro (3.3.1).  Everything I do is with deferred rendering per PW.  I started with a Gaia script-only set up on the target project, but after the import all my PW trees were white.  I did some digging and found the PWS/PW_General_Forward shader didn't compile due to include errors.  I tried a bunch of stuff:

 

* Restarted Unity

* Reimported the shader

* Reimported Gaia 3.3.1

* Did a google search on shader import errors (found a Unity bug)

* Updated Gaia to 3.3.5

* Installed all of 3.3.5 (this had worked for me with the same problem a couple of months ago)

* Searched Canopy (that's a useless search function)

* Stopped Unity, deleted everything in Library, restarted, reinstalled full Gaia 3.3.5.

 

Now asking for help.  I'd prefer not to update to Unity 2021 if I can avoid it.  Last time I tried it broke other assets.

 

Screenshot from 2023-01-31 17-41-20.png

Screenshot from 2023-01-31 17-44-18.png

Link to comment
Share on other sites

Sorry.  Built in. 

 

I worked around it by changing everything in the scene from PW_General_Forward to PW_General_Deferred, but that's temporary at best.   Everything that was Forward, that is, mostly tree leaves and needles.  I don't usually mess with shaders at all, so I don't know if it will make a difference or not.  But it's all green for the moment... 

Link to comment
Share on other sites

Hi @aldaluin, the errors are referencing the Built-In Shader include files - those should normally be part of your unity installation. It could not hurt to double check if those files are therein the path mentioned in the article I linked.
However, I also found this information that might relate to the problem: "If one of the include fails, it fails all built-in also.", see e.g. here:
https://answers.unity.com/questions/253378/cant-open-include-file-hlslsupportcginc.html

Can you identify any other shader include file that is NOT part of the Built-In Shader includes? That might probably the file that is missing and causes the other files to error (even though they are there in your file system)
What I do know from the top of my head is that the Gaia shaders also use include files found in the Procedural Worlds\Flora directory, did you copy this folder over as well? I do know that if the Flora files are missing, the Gaia vegetation appears white as in your screenshot, but this is then fixed by adding the Flora files back and re-importing the Gaia shader folder, which I think you have done already indirectly by installing / updating Gaia.

Link to comment
Share on other sites

  • 2 weeks later...

I've given up.  Killed the project and starting fresh.  I was never able to get the shaders to rebuild without complaining about includes, and broke PW_General_Deferred in the attempt (same errors).  This was an assembly project built with parts from others, so it might not be too bad to rebuild. 

 

Link to comment
Share on other sites

  • Solution

Well... I have something to add to your next update, please.  Did I mention I use a Linux editor?  I did not (just checked).  Sorry.

Exactly the same thing happened on the new project.  A bunch of white trees and two broken shaders.  This time I followed my gut instead of my head... and it worked.

In your next build, please change the name of the flora directory from "Content Resources" with a space, to "ContentResources" without a space.  It is the only place in all the includes that I can find where there is a space in a shader path.  I made that change in both the shaders and in the asset directory.  Now my trees are green again.   Just to make sure, I took the space back out, and PW_General_Deferred immediately broke again but PW_General_Forward did not.  This recreates my original problem.  

(A little time, a little distraction, and the instincts kick back in again...)

Link to comment
Share on other sites

12 hours ago, aldaluin said:

Well... I have something to add to your next update, please.  Did I mention I use a Linux editor?  I did not (just checked).  Sorry.

Exactly the same thing happened on the new project.  A bunch of white trees and two broken shaders.  This time I followed my gut instead of my head... and it worked.

In your next build, please change the name of the flora directory from "Content Resources" with a space, to "ContentResources" without a space.  It is the only place in all the includes that I can find where there is a space in a shader path.  I made that change in both the shaders and in the asset directory.  Now my trees are green again.   Just to make sure, I took the space back out, and PW_General_Deferred immediately broke again but PW_General_Forward did not.  This recreates my original problem.  

(A little time, a little distraction, and the instincts kick back in again...)

Thank you for the update. 
I will pass this information along! 

Link to comment
Share on other sites

  • 1 month later...

Hi @aldaluin,

we just reviewed this request again for an upcoming Gaia update. Adding this change in on a smaller update creates a problem with already existing installations: The unity package manager install process only allows us to add new files to the project; if we move them to a different folder, already existing files will remain in the same spot in the project.
This would create the problem that installing the new Gaia version over an existing installation would break the application unless the user deletes the old "Content Resources" folder beforehand. We can put such info in the patch notes, but from past experience, this still creates a lot of support requests where users do not see/read the info and break their installs this way.
We would therefore rather wait to introduce this change in a major update where we usually require a clean install anyways because folder structure etc. changed between the versions.

Link to comment
Share on other sites

  • 3 weeks later...

It makes much more sense to wait for a major release rather than duplicating the files.  Now that I know what to look for I can patch by hand for a while.  Or pretend it's snowing...

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...