needle-tools / procedural-stochastic-texturing

28 stars 5 forks source link

HDRP shader compilation error #7

Open krisrok opened 3 years ago

krisrok commented 3 years ago

Hi and thanks for your work to get this into Unity!

Blindly adding this to a 2020.3.8 project with HDRP 10.5.0 results in some compilation error on the Sample node. I'm not that familiar with ShaderGraph so I do not even know where to start to debug this :/

Shader error in 'Master': undeclared identifier 'samplerUnityBuildTexture2DStructNoScale' at line 1120 (on d3d11)

image

Can you maybe verify the package is working with newer versions? Maybe I'm just doing something wrong here. You mention a few known issues regarding importing and I fear this whole shader graph construct is a tad fragile in its current state -- so my issues might just come from the faulty import process?

krisrok commented 3 years ago

I dove a little further and opened your 2020.2-HDRP project in 2020.2.5 and got similar problems.

Shader error in 'Master': cannot implicitly convert from 'float' to 'struct UnityTexture2D' at line 465 (on d3d11)

Double clicking the log entry brings me to this (i guess temporary) Master shader: image

So I do not even know which file causes the error but i suppose it is referring to the MultiTextureGraph as there are no other .shadergraphs in the project (except the URP7 variant).

What surprised me there are the same errors but on other lines when I directly select the MultiTextureGraph: image

==

When I open the MultiTextureGraph in the graph editor there are no red error popups shown like it was on 2020.3.

On the other hand, when I create a custom graph: image

The node called "Sample Procedural Texture 2D" displays no errors though.

==

So i guess the error cannot implicitly convert from 'float' to 'struct UnityTexture2D' stems from the lines SurfaceDescription surface = (SurfaceDescription)0; (even though the line number displayed in the error is always one-off, but hey, close enough)

Inside the "Sample Procedural Texture Simple" subshadergraph thing I found there's a custom function node. I right clicked it and selected "Show generated code" to see this on line 158: SurfaceDescription surface = (SurfaceDescription)0;

Now I have an idea why/where this whole thing breaks but I do not have a clue why this faulty shader code is generated in the first place.

krisrok commented 3 years ago

Similar problems with 2020.2-URP opened in Unity 2020.2.5 URP 10.3.1. I've also tried the URP10 samples included in the main package.

I've tinkered around a bit but I guess you have enough input now :/ If I can be of help just holler. Thanks!

Danny-W-Richardson commented 2 years ago

Having the same problem, no one fixed yet?

hybridherbst commented 2 years ago

I'll take a look, sorry for the delay.

krisrok commented 2 years ago

Any progress so far?

nehvaleem commented 2 years ago

also interested in this

ddabble commented 2 years ago

Would be nice to have this fixed 🙂

mikelortega commented 2 years ago

I'm also having the exact same problem @krisrok mentions with Unity 2022.1.1f1 and HDRP 13.1.8 I have not found a workaround 😔