1
\$\begingroup\$

I have a REALLY specific case here:

I have an Texture (a webcam), that is used by a shader to pickup a few x,y colors at the cordinates, and renders to a Custom Render Texture, that is later fetched (download pixel color information from GPU to CPU), and I can handle the algorithm from there.

The thing is, once I upgraded the project to PBR (Physically Based Rendering), all my Unlit scripts become PINK, and they stopped working.

This is a special case because:

  1. It doesn't need to appear on the screen
  2. It acts as a "Compute Shader", but with backward compatibility to old phones
  3. It works well without PBR, but once PBR is enabled it becomes pink and stops working
  4. It doesn't need to reflect, refract, output pixels or anything to the "Screen", only to my Custom Render Texture so that I can fetch it later.
  5. The algorithm doesn't fits on a Graph based programming (it has iterations and etc)

Well, I didn't find documentation on how to write custom PBR shaders and here I am.

\$\endgroup\$
  • \$\begingroup\$ Generally pink shaders is a result of a compilation error which can happen when targeting a new version of Unity. Could you select the shader asset in the Unity editor and copy any errors it shows in the inspector here as well as posting your code? \$\endgroup\$ – Thomas Mathieson Feb 23 at 16:00
0
\$\begingroup\$

I had the same problem. I think you need to create a Lightweight Render Pipeline Asset on my Assets folder (r-click -> create -> Lightweight Render Pipeline Asset) then dragged it to my Graphics settings (Edit -> Project Settings -> drag to Scriptable Render Pipelline settings). After that go to Edit -> Render Pipeline -> Upgrade Render Material to LightweightRP Material. Then you napply yout material. Hope this helps even it's not the same scenario.

Edit: adding note: To download Lightweight Render Pipeline you need to go to Window -> Package Manager and enable Previews under the Advance dropdown.

\$\endgroup\$
  • \$\begingroup\$ I am pretty sure you are doing @Brackeys Dissolve video tutorial haha here's a video that might help: youtube.com/watch?v=vh85pzT959M \$\endgroup\$ – Ph0b0x Feb 12 at 18:53
  • \$\begingroup\$ Actually I'm probing an image in realtime, so I can get information from the image in a "compressed" manner... The shader I'm using will not even appear on the screen, it's just Data processing on the GPU without any rendering :) \$\endgroup\$ – Ivan Seidel Feb 12 at 18:56
  • \$\begingroup\$ I have converted the pipeline to an Lightweight Render Pipeline, that is not my problem.. the problem is the shader I wrote (a unlit shader) is no longer working on the new Lightweight Render Pipeline =/ \$\endgroup\$ – Ivan Seidel Feb 12 at 18:57
  • \$\begingroup\$ Oh shoot! Sorry and good luck. \$\endgroup\$ – Ph0b0x Feb 12 at 18:59
  • \$\begingroup\$ I created a new Unlit shader on the project i am using LWRP to try and replicate your issue but i get a few errors on mine. One is script related and the other is GPU not compatible. I will try to do it on my gaming rig later to see what i can find (using a MAC Book Pro now). Did you find a fix? \$\endgroup\$ – Ph0b0x Feb 13 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.