# Does Shader graphs actually work?

**URL:** <https://forum.needle.tools/t/does-shader-graphs-actually-work/1253>\
**Category:** 🌵 Needle Engine\
**Tags:** question\
**Created:** [July 8, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253 "2023-07-08T00:00:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [July 8, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/1 "2023-07-08T00:00:00Z")

</div>

I’m testing needle features with a simple project, but got stuck when trying to use very simple shader graph, as you can see in the image I’m using it in a cube and also the ground, but (on the right side) the end result just renders both objects with the default material apparently (I’m guessing that the white is there because of the default material being applied).  
My Unity version is 2022.3.4f1 (LTD), the shader itself is an unlit and I’m using the Build-in Render Pipeline.  
Am I missing something?

 ![2023-07-07_14_44_07-.png](https://europe1.discourse-cdn.com/flex006/uploads/needle1/original/2X/9/9a6de3e6ef5742b785c32c01aadab7f5a8aa7fa8.png)

[Original Post on Discord](https://discord.com/channels/717429793926283276/1126934766952927263)

_by user 368204675922657280_

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [July 8, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/2 "2023-07-08T00:00:00Z")

</div>

Hi is the material or shader marked with `ExportShader` ?

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [July 8, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/3 "2023-07-08T00:00:00Z")

</div>

Another thing that you can try is downloading/installing the Needle Engine samples, particularly the custom shader scenes

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [July 8, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/4 "2023-07-08T00:00:00Z")

</div>

You have probably seen it, that’s the scene built with shader graph [Needle Engine Samples](https://engine.needle.tools/samples/?room=398&open=1#shaders)

If it’s not working still let us know and let us know which needle engine versions you’re using too. Thanks

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [July 9, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/5 "2023-07-09T00:00:00Z")

</div>

Hi! Thanks for the answer!  
What do you mean by “marked”? AssetLabels? Tags? Layers? How do i know if needle is exporting them? (I’m saying this because from what i know, it only re-exports when there are changes in the hierarchy).  
Regarding the Samples, i downloaded the samples via package manager and then proceeded to start a local server from the sample scene that you mentioned, yet all meshes appear black :classyblobthink:

My Needle-Engine version is 3.7.5-pre. Regardless i think that these details should appear in the docs or in a video, it would be nice if there was a step by step video for setting up shader exports correctly.

_by user 368204675922657280_

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [July 9, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/6 "2023-07-09T00:00:00Z")

</div>

Docs about shaders/custom shaders are here. [Exporting Assets to glTF | Needle Engine Documentation](https://engine.needle.tools/docs/export.html#custom-shaders) I meant Asset tags

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [July 9, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/7 "2023-07-09T00:00:00Z")

</div>

Appear black: that sounds not good - Will open an issue

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [July 9, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/8 "2023-07-09T00:00:00Z")

</div>

Thanks for the replies! ill be checking out to see if i can make it work

_by user 368204675922657280_

---

<div class="post-metadata">

**Author:** ![hybridherbst](https://forum.needle.tools/user_avatar/forum.needle.tools/hybridherbst/32/3416_2.png) [@hybridherbst](https://forum.needle.tools/u/hybridherbst)\
**Post date:** [July 10, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/9 "2023-07-10T00:00:00Z")

</div>

Hey, did you get it to work? 🙂

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [July 10, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/10 "2023-07-10T00:00:00Z")

</div>

Yes! I added the ExportShader asset label, close and open Unity again, it throws me a couple of errors but from the typescript code (apparently it does not get rid of previously serialized properties if i delete them after).  
The sample scene looks like it works, but the color still appears black, no change on that. Hope this helps someone!

 ![image.png](https://europe1.discourse-cdn.com/flex006/uploads/needle1/original/2X/d/d13551f195c31e73fae0fe341820c538be259e04.png)  
 ![image.png](https://europe1.discourse-cdn.com/flex006/uploads/needle1/original/2X/0/0f320fccff3ae39118052f235f861889bf398729.png)

_by user 368204675922657280_

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [July 10, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/11 "2023-07-10T00:00:00Z")

</div>

Can you explain what you mean by `apparently it does not get rid of previously serialized properties if i delete them after` ?

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [July 10, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/12 "2023-07-10T00:00:00Z")

</div>

And can you share the errors that you’re getting?

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [July 10, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/13 "2023-07-10T00:00:00Z")

</div>

About the errors:  
I had something like this:

```typescript
export class Player extends Behaviour{
    @serializable()
    anims? : Animator;
    @serializable()
    bullet? : AssetReference;
    //Start function and everything else...
}

```

Then the errors where:  
Missing Serialization for object reference! x2 (one for each property)

After that i did this:

```typescript
export class Player extends Behaviour{
    @serializable(Animator)
    anims? : Animator;
    @serializable(AssetReference)
    bullet? : AssetReference;
    //The rest of the code...
}

```

And it solved the reference issues. Now the thing is:  
Lets say i don’t want the “anims” property to be serialized anymore, so i just get rid of the “@serializable(Animator)” declaration, but it still appears in the inspector.  
Is there a way to hide it to avoid any confusion regarding the references?  
 ![image.png](https://europe1.discourse-cdn.com/flex006/uploads/needle1/original/2X/1/17b63b4bde5b6848b8b7d5b3b6eed02f4385ae5f.png)

_by user 368204675922657280_

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [July 10, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/14 "2023-07-10T00:00:00Z")

</div>

Nevermind, i found that “private” keyword is also a thing in typescript! :gentleblob:

_by user 368204675922657280_

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [July 10, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/15 "2023-07-10T00:00:00Z")

</div>

you can:

- make the field private
- mark it with `// @nonSerialized` as a comment in the line above you can find the component compiler options in the docs

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [July 10, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/16 "2023-07-10T00:00:00Z")

</div>

Ah yes private 🙂

---

<div class="post-metadata">

**Author:** ![kipash](https://forum.needle.tools/user_avatar/forum.needle.tools/kipash/32/54_2.png) [@kipash](https://forum.needle.tools/u/kipash)\
**Post date:** [July 11, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/17 "2023-07-11T00:00:00Z")

</div>

Hey 👋 It seems that on 2022.3.4f1 using built-in render pipeline results in non functioning custom shaders. If you are able to, please use URP

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [July 11, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/18 "2023-07-11T00:00:00Z")

</div>

It works as expected in 2021.3.28 with BiRP too. Going to try with 2022 now

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [July 11, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/19 "2023-07-11T00:00:00Z")

</div>

I built a shader like in your example above and it doesnt reproduce here in 2022.3.4 - do you think you can send us the scene with the bugreporter? (Needle Engine / Report a bug)

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [July 11, 2023, 12:00am UTC](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253/20 "2023-07-11T00:00:00Z")

</div>

![image.png](https://europe1.discourse-cdn.com/flex006/uploads/needle1/original/2X/b/b45dac7942e17507e40f36ef3a7bd4d42e55636c.png)

[Next page](https://forum.needle.tools/t/does-shader-graphs-actually-work/1253.md?page=2)
