Jump to content

Bug? Grass shaders randomly break (shader turns pink) - Unity 2021.2.12f - [solved]


Haxel0rd
Go to solution Solved by Peter,

Recommended Posts

Hello there,

before posting, i made sure this was not caused by my fault, and i waited if the problem was re-appearing,
which unfortunately it did. This is the 3rd time now this happens, not sure though if it appeared after cleaning
and respawning the grass- however, i did not touch the default settings- nor the assets used for the grass.

Setup:
I'm on Unity 2021.2.11f, (tested also in 2021.2.12), GaiaPro 2021 with HDRP Renderpipeline and using the default
grass Spawner "Gaia Pro Sample-Grass".


Problem Description:
Randomly, or at maximum after despawning/respawning the grass, it happens that all the white grass seen in
Editor mode (image-1), does not show up in play mode. In play mode then, the white shown grass is gone and
instead pink spawns of "Flower Red" are seen, but without showing the texture. Checking the settings, everything
seems normal, also the connected textures.

Restoring a backup from earlier working versions does not work - even the backup scene is affected!
(option "autosave when press play" is turned off - so this shouldn't happen at all).

What i have tried already:
- despawning/respawning the grass several times
- deleting the spawned grass manually by hand
- re-importing the pink gras shader
- converting flower shader to HDRP material via unity menu
- setting Renderpipeline back to built-in and back to HDRP in hope that the HDRP setup would be freshly applied
- upgrading to Unity 2021.2.12, as suggested here: https://canopy.procedural-worlds.com/forums/topic/339-terrain-details-in-build-vs-in-play-mode-in-editor/
- also tested these suggestions, without success: https://www.youtube.com/watch?v=nB0r0c-SIVg 
  ("Why so pink - how to fix pink materials").

Reproducable:
No, but i have the broken state currently still available. You can reach me on Discord (write to "ToniTester" account, not
Haxel0rd), i can offer TeamViewer/AnyDesk if any dev wants to look further into this (i have stable internet & fast pc).

Screenshots:
1) Editor view (game not running)
grassBug1.thumb.jpg.b4f9e30a6c955c026d0974eb4c280224.jpg

2) In-game view, game running
grassBug2.thumb.jpg.3c999ef6e22b90349efdf2f0ebfd12c5.jpg
NOTE: when checking the spawners, all settings and textures looked good, but what's fishy is this pink shader called
"PW_Details_Foliage_Builtin", this is on the "Flower Red" spawner, which is affected by the problem described above.

Solution:
EDIT: solved, see Peters anwers:
https://canopy.procedural-worlds.com/forums/topic/466-bug-grass-shaders-randomly-break-shader-turns-pink-unity-2021212f/?do=findComment&comment=2259&_rid=932
 

Thank you.

Link to comment
Share on other sites

  • Haxel0rd changed the title to Bug? Grass shaders randomly break (shader turns pink) - Unity 2021.2.12f

This is a Unity thing. If you see a pink material then that means it's a shader mismatch. As in it's standard and you're on HDRP.

When you switched back to standard if also reset all your textures to standard.

Just so a convert all materials to HDRP for catch any materials you have still in standard.

  • Thanks 1
Link to comment
Share on other sites

Hey,

thanks for the input, i tried this before but only with selected ones,
so i tried again this time selecting "all built in materials", but this still
does not work.

Thanks & Regards!

Link to comment
Share on other sites

  • Solution

@Haxel0rd The pink materials in the screenshot use the built-in Flora shader, if you switch them to the HDRP shader it should work, select all pink materials in that folder and switch them to this shader:
image.png

It is a bit strange though because normally Gaia should do this switch by itself:

  • When you load in a spawner in a HDRP project it should automatically create those materials with the HDRP shader
  • If you have an existing scene at the point where you switch to HDRP it should go over the already existing materials and migrate them to HDRP during the pipeline switching process in Gaia.

Not sure why this did not happen here, but if you switch the material manually it should be fixed.

  • Thanks 1
Link to comment
Share on other sites

==============================
Peters answer is the solution to this problem!
==============================

I recommend this to anyone who has problems with pink / invisible / disappearing grass.
(i had both, pink AND invisible grass, after fixing shaders you may need to respawn).

On 2/20/2022 at 5:46 AM, Brandon Dixon said:

Just so a convert all materials to HDRP for catch any materials you have still in standard.

Thank you Brandon, your answer was correct too 👍it just didnt work for me because gaia and even unity (via convert menu) didn't catch those shaders, but after applying by hand according to Bryans answer, it then worked. This was very similiar to the solutions from "why so pink" video, but those didnt work, bryans answer was specifically targeted for gaia shaders, that in the end helped me to solve the issue.

On 2/22/2022 at 2:54 PM, Peter said:

It is a bit strange though because normally Gaia should do this switch by itself:

Even unity with conversion to HDRP didnt catch those. I believe this is a major reason for many support requests that reaches PW-Team, maybe if you find a fix for that it could help reduce the ticket inflow.

Peter, thank you so much again! This problem has been bugging me the whole weekend, i invested
many hours chasing it. I also tried switching shaders before but it seems to the wrong ones-
the one from your screenshot works!

Thank you very much!

  • Like 1
Link to comment
Share on other sites

  • Haxel0rd changed the title to Bug? Grass shaders randomly break (shader turns pink) - Unity 2021.2.12f - [solved]

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