Skip to main content

Questions tagged [unity-shader-graph]

Unity Shader Graph is a Unity tool that allows users to create shaders using a drag-and-drop graphical interface without writing any code.

Filter by
Sorted by
Tagged with
5 votes
2 answers
4k views

Material is flickering in Unity

I'm trying to make a grid like, light up floor using Unity's Shader Graph. However, I am having an issue where the lines are flicking after a really short distance when the camera is moving. The ...
Dan's user avatar
  • 185
5 votes
1 answer
5k views

How to declare per-instance properties for instances rendering on a shader graph?

Unity Version: 2019.4.1f1 Render Pipeline: URP I created a shader using Unity's Shader Graph, and I want to apply GPU Instancing on this shader, but there is no way to declare per-instance properties ...
Fadi Obaji's user avatar
3 votes
1 answer
5k views

How to deal with insane amount of shader variants waiting to be compiled in Unity >= 2021.2 / URP >= 12?

Since Unity 2021.2.0b7 (that is, URP 12.0.0), there has been a well known problem with absurd number of shader variants wanting to be compiled for even a somewhat simple shader (i.e. shaders generated ...
user213769's user avatar
3 votes
1 answer
974 views

If UV coordinate is Vector2, then why does UV node in shader graph output Vector4?

I'm new to shader, so please pardon my lack of knowledge. I am trying to understand what does UV node do in shader graph. I tried searching on google and in https://docs.unity3d.com/Packages/com.unity....
bbzz's user avatar
  • 137
3 votes
1 answer
623 views

Procedural mesh comes out black in any shader

I wrote a script that Creates a mesh procedurally ...
kei's user avatar
  • 235
3 votes
1 answer
2k views

How can I map a texture around a sphere without a seam?

I am attempting to wrap a texture around a sphere without any warping using Unity's Shader Graph. I have been following this StackExchange answer, and have semi-successfully converted their shader ...
Harper Rhett's user avatar
3 votes
0 answers
1k views

How to check if Texture 2D was provided in shader graph?

I have following section in my shader graph, that I want to simplify. At the moment I have to set manual boolean Use Normal Map in order to decide if I want to use a Normal Map texture or default ...
Ilja's user avatar
  • 143
2 votes
1 answer
3k views

How can I blend the center color of a 2 side gradient so it isn't as harsh looking in Unity Shader Graph?

I am using the gradient node in Unity's Shader Graph. It is 2 sided, with it being black-white-black. The white is quite harsh, it makes a line that stands out. I will be using this as a mask, and ...
JacketPotatoeFan's user avatar
2 votes
3 answers
10k views

Convert shader that uses a texture array to ShaderGraph

I am working on procedural generation in Unity, and am now a bit stuck. I am using Perlin noise to generate a heightmap, including lacunarity, persistence, octaves and frequencies. Today I have been ...
Tom Scott 's user avatar
2 votes
2 answers
16k views

Understanding Screen Position Node in Unity Shader Graph

I'm struggling to understand what exactly the Screen Position node outputs in Unity's Shader Graph. I'm using the screen position with scene depth to calculate the distance between two objects. Every ...
Martin's user avatar
  • 153
2 votes
1 answer
20k views

PBR Graph option not showing up in Unity

I downloaded the URP render pipeline into an existing project of mine (created using the 3D template) to try out shader graphs. All of the guides and tutorials I'm following use an option called the &...
KI.'s user avatar
  • 462
2 votes
1 answer
7k views

Unlit Node Shadow Shader Graph

How to make unlit node cast shadows? Is is possible with the current state of Shader Graph in LWRP? In this great article Toon Shader OP grabs pass from VertexLit shader. Is something similar ...
Candid Moon _Max_'s user avatar
2 votes
0 answers
247 views

How to get wave height of a gerstner wave made in shader graph?

I have followed a gerstner wave shader graph tutorial. (YouTube Tutorial) I am now trying to implement buoyancy by attaching the following script to a gameobject. (YouTube Tutorial) ...
Magnality's user avatar
2 votes
0 answers
2k views

Collapse a 3D model to 2d with Shader?

I'm trying to recreate an effect of 3D sprites similar to Ocotpath Traveler (2d sprite similar to billboards/imposters in 3D space, showing 8 sides of the character based on where they're facing), ...
Gregor A. Lamche's user avatar
1 vote
2 answers
2k views

Sprite Shape & URP Custom 2D Lighting Shader

I've been losing my mind over this for a couple of days now, and can't find any concrete information about it. I am trying to write a custom shader (shader graph to be specific) to light sprite shape ...
Cristian C.'s user avatar
1 vote
1 answer
2k views

How to sample from six cubemap images for a skybox in Shader Graph?

I'm trying to update a skybox shader to URP and reimplement it in Shader Graph. The shader code itself is pretty straightforward, but I don't know enough about Shader Graph yet to set up the basic ...
Mason Wheeler's user avatar
1 vote
1 answer
4k views

Dissolve object starting from the bottom

I'm currently getting into using the new "Unity Shader Graph"s and have made an OK dissolve shader that looks like this: My next goal is to move this effect so the object dissolves bottom-up. This is ...
Charanor's user avatar
  • 8,048
1 vote
1 answer
259 views

Unity shader to give thickness to flat plane

I have this hexagonal grate floor: Which is a flat plane with the following shader: The hex lattice created using the method by Andrew Hung. Albedo and metallic/smoothness shader are just simple ...
Dr Rob Lang's user avatar
1 vote
1 answer
2k views

Why does setting blend mode in Unity shader graph to Multiply create artifacts on sprite?

I want my sprite to use a blend mode based on the background (like in Adobe programs) so I set shader graph blend mode to Multiply. The blend works, but I get strange artifacts on my sprite. In this ...
Ivan's user avatar
  • 349
1 vote
1 answer
3k views

Unity Shaders: Why is it recommended to use Time to animate things inside of a shader instead of DeltaTime?

In the "Built-in shader variables" section of the Unity Manual, underneath the Time header, there is a table that provides information about each time variable: _Time; _SinTime; _CosTime; ...
Jake Matthews's user avatar
1 vote
1 answer
965 views

Adding a shader graph material as a second material

I'm attempting to make an outline shader that I can attach to selected objects by following this guide. After making a new material and assigning the new Shader Graph as the shader, I'm not sure how ...
David Starkey's user avatar
1 vote
1 answer
327 views

Can I use Unity's free assets for commercial purposes?

i have a question, if someone is developing a game on unity for commercial purposes, can free or even paid assets be used in the game even if it is to sell the game? are assets not subject to ...
BRUNO's user avatar
  • 11
1 vote
2 answers
739 views

Renaming Texture 2D nodes in Unity's shader graph?

I am new here so thanks for having me. I have a query regarding renaming the Texture 2D nodes I have created in my first Shader graph. I have setup a shader graph with a normal map, base colour, ...
Nick's user avatar
  • 11
1 vote
1 answer
5k views

How to add mesh collider which updates with water wave vertex offset?

I have written a shader (in the new LWRP shader graph) which simulates an ocean with vertices which offset to create a moving "waves" effect. I believe that in order to have objects "float" on my ...
Ben Hayward's user avatar
1 vote
1 answer
133 views

How to add "Visual Effect" as an active target in a Unity 6 shader graph?

I've just started learning and getting into shader graphs in Unity and I was just watching some tutorials on Youtube and realized that in the video, when he created the shader graph, he could add &...
rck's user avatar
  • 21
1 vote
1 answer
2k views

Cloud based fog of war

I'm working on a Unity 3D game that requires fog of war. It is seen from above. I was looking for help and found this: (I dont know what game it is though) This would perfectly fit my needs but I don'...
jm-laliberte's user avatar
1 vote
1 answer
292 views

Ensuring world curving shader is not affected by object scale

I've made a shader shown below which essentially acts as a "world bend / curve" shader by "bending" objects depending on their position from camera. It's a subgraph that outputs ...
Ilja's user avatar
  • 143
1 vote
1 answer
789 views

I need help converting Unity .shader to Shader Graph: Bumpy Glass

I've been tasked with converting an older Unity shader which does Bumpy Glass with some alpha modification, to URP. I'm assuming that means using Shader Graph. I'm a bit new to shaders in general, but ...
Dave's user avatar
  • 111
1 vote
0 answers
56 views

My shadergraph animation gets extremely faster during in the actual game compared to the editor

Currently I'm using a shadergraph for an animated material, for some reason as long as I don't have any input it works as intended and with the correct speed, while if I do any action/input the ...
Seo's user avatar
  • 11
1 vote
0 answers
82 views

How to create intersection shader that simulates squishing?

I want to create a shader that will make spheres/circles look like a blob when colliding. I don't understand shadergraph at all, but I tried to follow intersection shader tutorials. The problem is ...
Pinet's user avatar
  • 11
1 vote
0 answers
557 views

(URP Shader Graph) Why can´t I connect a float into another float 'slot'? Are there different types of floats?

So, here I´m just trying to take in a Vector3 (resulting from multiplying some noise and a sample texture) and putting it as the vertex position, but for some ...
Will Laccerd's user avatar
1 vote
1 answer
791 views

Vertex Displacement Shader Graph With The Camera Moving Issue

I have a foliage sway shader, that works well. But when the camera moves the vertex displacement stops: And the weird thing also is that if I move the camera to the right nothing seems to happen, ...
Kinan GH's user avatar
1 vote
0 answers
411 views

How to create a seamlessly wrapping procedural brick material with a shader?

How do you create a shader that seamlessly wraps a brick pattern around the whole object, so that there are no "Stitches" at any edges/corners? Take this screenshot for example: On the left ...
SePröbläm's user avatar
1 vote
0 answers
41 views

I have a problem with updating a RenderTexture being used in combination with a shader

I just can't seem to figure out why I can't save the image I've drawn onto an orthographic RenderTexture. Here's how my scene works: https://i.sstatic.net/6XkRo.gif Basically, it's a painting effect ...
xxhoisinxx's user avatar
1 vote
0 answers
82 views

Unity shader graph slow

Unity 2020.3.12f1 HDRP Whenever I add a single node in Shader Graph, the progress bar "compiling shader" takes around 20 seconds to complete. Multiply that by dozens of nodes and we're ...
gatzkerob's user avatar
  • 111
1 vote
0 answers
82 views

How to create fallout intensity on a generated mesh in Unity?

So I was able to generate a circle mesh in Unity to basically see the other characters when they are inside of it, and hide the characters when they are outside of it, and partially hide and show the ...
Blogy Junky's user avatar
1 vote
2 answers
846 views

How to hide player when in Shadow using Unity 2D Light System?

I have been looking for this for a couple of days now and cant find an answer; how can I hide a player when they are in the shadow when am using Unity 2D Light System? I know I can choose not to cast ...
Poula Reda's user avatar
1 vote
0 answers
2k views

How to randomly change the color of a Shader Graph Material for only a specified GameObject, with C# script?

I'm working on a game, in Unity3D, where the player picks up trash from Trash cans, and dumps the trash from the Trash cans into a Trash Truck. The world of the game itself is randomly generated, with ...
Fox GAMING_NTF's user avatar
1 vote
0 answers
723 views

Shader graph in Oculus (Screen position)

I have created a blur shader graph to blur a material. It works perfectly fine in the scene mode and also in windows application. However it does not work as expected in Oculus VR. That is, the ...
Saif's user avatar
  • 153
1 vote
2 answers
2k views

How do you get the world position from the screen position in a URP shader graph used in a ScriptableRenderPass?

I'm using a shader graph in the Universal Shader Pipeline (URP) to do some post-processing in a ScriptableRenderPass. How do I get the world coordinates of the screen position? I have tried using the ...
Sirius 5's user avatar
  • 139
1 vote
0 answers
360 views

Unity Shader-Graph randomly tiled sprite

Lets say I have a shader with a clean white tile. Then I use it on a wall and tile it a few times. I also have a sprite with numbers. Now, is it possible and if yes how. To put a random sprite ...
theCodeHermit's user avatar
1 vote
0 answers
70 views

Aligning cube faces Unity

I am using a shader that uses a gradient noise node and time to add a wavy effect to a grid like texture. The issue with doing this is that it causes the lines to be misaligned on the different faces ...
Dan's user avatar
  • 185
1 vote
0 answers
2k views

Draw a perfect circle in UI

This is the problem I have. I have created a shader that draws circle. But depending on the distance from the camera thickness changes. Is it possible to keep thickness constant?
Candid Moon _Max_'s user avatar
1 vote
1 answer
1k views

Do not cast shadows when transparent in unity

I am developing a game for WebGL and I have a shader that makes parts of an object in specific ranges of coordinates transparent, like so: This shader makes all parts of an object with an absolute Y-...
palkonimo's user avatar
  • 111
1 vote
1 answer
1k views

How can I incorporate subsurface scattering into a custom shader graph?

I'm working on some 3D grass in Unity with HDRP (the grass is not a 2D asset on a plane, it's a mesh). I did a shader to make it move following a tutorial, it works great. I would like to add ...
Arthur's user avatar
  • 11
0 votes
1 answer
3k views

Making a crosshatching effect in Unity Shader Graphs

I'm learning Shader Graph and am trying to experiment with toon shading effects. One thing I'd love to do is make a traditional art styled crosshatching effect either inside shadows or at the edge of ...
JSparks's user avatar
  • 199
0 votes
1 answer
1k views

Converting shader to ShaderGraph

Is there a way to convert the below piece of shader code to shader graph? I am not sure how to find float2(i, i) in shader graph. ...
Saif's user avatar
  • 153
0 votes
1 answer
301 views

Creating a pinch distortion shader

I'm attempting to recreate this effect using a shader in Unity, using version 2023 with HDRP: The effect appears to be pinching pixels behind the object the shader is applied to and dragging them ...
Sean2148's user avatar
  • 145
0 votes
2 answers
283 views

How would I make my water shader ripple?

I can easily make a basic water shader, and create a script that detects when something touches the water, but does anyone know how I would actually trigger a ripple in shader graph? I'm not asking ...
Pow's user avatar
  • 414
0 votes
1 answer
158 views

How does vector raised to the power of another vector work?

I was watching this tutorial and at timestamp 3:03 he did this: This blows my mind because I didn't expect that to actually work, how the heck does that work ???? For example, if I have vector (2, 3, ...
bbzz's user avatar
  • 137