Bug related to Unity Projectors

Node-based Shader Editor

Bug related to Unity Projectors

Postby NoahOrtega » Thu Dec 06, 2018 3:02 am

Alright, I've spent multiple days now on this saga to figure out why a projector shader I made (using Amplify) worked perfectly fine when being projected onto the default Unity shader but would not appear on a material using the main Amplify shader I built. Here's the basic breakdown of events in order that led me to discovering this bug:

1. Projector not working on main amplify shader, no problem I'll figure this out easily!

2. Tried everything I could possibly imagine in an attempt to get the projector to work on my shader, including unplugging all of my nodes and changing every possible property, nothing fixed the issue.

3. Tried making a duplicate of the shader (copy/paste then renaming in windows explorer and changing shader name in the editor), still didn't work.

4. Created a brand new shader and copy/pasted all of my nodes from the old shader into it, while also matching everything in the properties settings to make sure it was perfectly identical. THIS FIXED THE ISSUE, BUT WHY???

5. Explored every possible setting in the fixed version in an attempt to break it and figure out what caused the problem in the first place. Ended up discovering that as soon as you change the render type to transparent the shader will no longer work with projectors. This was interesting because my original shader that still wasn't working WAS NOT SET TO TRANSPARENT, IT WAS OPAQUE!!!! Also, after switching the previously working version back to opaque IT WAS NO LONGER WORKING!!!

6. O.K........... so now I know that as soon as a shader gets set to render type: transparent it will never work with projectors ever again even if it's no longer set to be transparent (old one was based on another shader that used opacity so it was flagged as transparent in the past). So now the question is why is this happening and can I fix it?

7. I'm not a programmer and really dislike working in code but for this I made an exception. So what did I find in the tags right under SubShader but this: "IgnoreProjector" = "True". AH-HA, I found the problem, so easy-peesy, I delete that tag, check the shader in my scene and the projector is actually appearing on it WOO-HOO!!! Unfortunately the instant I save my shader in the editor that tag re-appears in the code............FFFFFFFFFFFFFFFFFFFFFFFFFFFFUUUUUUU

8. So now the search begins for what's causing that tag to re-appear after it's been deleted AND the shader isn't set to transparent. There are too many variables with my working shader so now that I've identified the problem and how to re-create it I make a brand new empty shader for testing with zero nodes.

9. I check the code on the empty shader, there is no "IgnoreProjector" = "True" tag and the projector works on it. I set the render type to transparent, the tag appears, projector no longer works, delete the tag, set to opaque, projector works again BUT the instant I save the shader the tag re-appears. So the permanent tag bug happens on an empty shader.

10. Something must be saving that tag information and telling the shader to re-add it, the question is where is that information saved? I tried making a duplicate, deleting the metadata and re-naming in windows and the shader name in the code, still broken. I even made a copy, completely renamed it, e-mailed it to a programmer I worked with and he imported it into a new Unity project on his machine..........still broken, we could not get that tag to stay gone.

11. Final attempt, we looked further into the code and discovered that one of the MANY flags in the commented out section at the bottom of the code was causing the tag to continually be re-added to the code. The only fix I currently have for this issue is to delete all of the commented out code at the bottom. This basically forcibly resets all of those tags to actually match whats in the code above because once you save the shader all of that commented section is automatically re-populated. Unfortunately, because I have no way of identifying the specific true or false tag related to ignore projectors I end up deleting everything which erases all of my nodes/wire connections in the shader editor, thus making it impossible to edit that shader through the node editor ever again.

12. TLDR, if you set a shader to render transparent it will never be compatible with projectors ever again no matter what you do. All I want is for the tags in the code to be properly updated when you update the nodes or properties in the shader editor.

I can send screenshots or anything else if you want, but as I said above you can easily recreate this bug with an empty shader yourself.
NoahOrtega
 
Posts: 3
Joined: Fri Oct 26, 2018 8:35 pm

Re: Bug related to Unity Projectors

Postby Ricardo Teixeira » Thu Dec 06, 2018 12:24 pm

Hey there,

Thanks for the detailed explanation but this does not seem to be a bug.

Code changes made to ASE shaders will be discarded after saving it. As far as ASE is concerned, the only valid information is the metadata that you mentioned in the end of the file, this is where we store all our information.

You can set that tag directly in the editor, this way it will remain in the shader.

Can you share the shader where you're trying to set the tag? Alternatively, let us know which type exactly and we'll point you in the right direction.

Thanks!

PS:Hope you don't mind, I adjusted your thread title.
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Bug related to Unity Projectors

Postby NoahOrtega » Thu Dec 06, 2018 3:58 pm

Hey Ricardo,

Goddammit, apparently I didn't see the checkbox for ignore projector earlier on when I was looking at properties then after that I was completely focused on looking at the code.

This is still a bug however because once you set the render type/queue to transparent it automatically sets that checkbox to on without warning and NEVER turns it off. The only way to fix it is by disabling manually, I imagine that if this was working as intended that property would toggle on/off depending on the render type/queue settings, instead it only ever turns it on. I'll send a link to some screenshots of my main shader with this issue, the shots are purposefully not hi-res because this shader was built for work and the issue has nothing to do with nodes.

https://drive.google.com/open?id=1Fr4UIsoBS_FO213f8mSui1NfBEpGSgBq
NoahOrtega
 
Posts: 3
Joined: Fri Oct 26, 2018 8:35 pm

Re: Bug related to Unity Projectors

Postby Ricardo Teixeira » Thu Dec 06, 2018 4:08 pm

NoahOrtega wrote:Hey Ricardo,

Goddammit, apparently I didn't see the checkbox for ignore projector earlier on when I was looking at properties then after that I was completely focused on looking at the code.

This is still a bug however because once you set the render type/queue to transparent it automatically sets that checkbox to on without warning and NEVER turns it off. The only way to fix it is by disabling manually, I imagine that if this was working as intended that property would toggle on/off depending on the render type/queue settings, instead it only ever turns it on. I'll send a link to some screenshots of my main shader with this issue, the shots are purposefully not hi-res because this shader was built for work and the issue has nothing to do with nodes.

https://drive.google.com/open?id=1Fr4UIsoBS_FO213f8mSui1NfBEpGSgBq


Ah yes, I see what you mean now!

That part specifically should be adjusted, thank you for bringing it up, we really appreciate it.

Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 0 guests