#archived-shaders

1 messages · Page 135 of 1

meager pelican
#

The funny thing is that graph ^^^ probably ends up being like 10 lines of actual code, plus declarations. :p

leaden gyro
#

Yes yes but yay for nodes 🙂

devout quarry
#

hmm

#

The more I use SG, the more I write code 🙂

meager pelican
#

To each their own. 🙂

leaden gyro
#

May I interest you in my religion

#

Only NodesTM

meager pelican
#

lol

devout quarry
#

@leaden gyro have you noticed any performance issues when working with larger graphs?

#

Especially when adding properties

leaden gyro
#

Not yet

#

but I know that is a thing

#

But the technology will develop, especially since its so new in Unity

devout quarry
#

I experience it all the time, very very very frustrating and killing my workflow

leaden gyro
#

Well there is lag when making properties, yes

#

but thats just unity being stupid

#

theyll fix that sometime soon i guess

devout quarry
#

yeah but I'm speaking about 3-5 second hangs

#

same when renaming properties, renaming references, changing nodes etc

leaden gyro
#

Hahah only a few months ago the whole window would crash if you changed a property name

devout quarry
#

and I'm always on the latest SG version, always hoping for improvements, but nothing yet

leaden gyro
#

But yeah itll pass once Unity gets this buggy mess under control. Its pretty fair, since its such a new system

#

Unreal has had so many years to optimize it

#

Its a wonder it works so well in Unity

devout quarry
#

Idk, it's almost 2 years since release

leaden gyro
#

with the different render pipelines, everything is a mess right now. I guess we gotta be patient

devout quarry
#

I'm not sure if this is better asked somewhere else but it's shader-related so here goes

#

Has anyone here worked with Gerstner waves?

#

I'm using 3 waves here, but I'm still getting a hard time getting it to look right. It looks good to me, but it's still super easy to pick up a pattern. What techniques could I use to make it a bit more 'random'?

#

I'd love to hear some techniques of people that have used these

fervent tinsel
#

that's about as far as I got with it myself

#

I never got it look like real ocean but didn't spend much time tweaking it

devout quarry
#

I read some guy's master thesis

#

and his solution to get rid of the patterns is applying noise

#

which I'll try I think

#

I'll also do some depth-based attenuation, that might get rid of some repetition

#

@fervent tinsel you did this in shadergraph right? What was your setup like? Just 1 custom function node? 1 custom function node per wave?

fervent tinsel
#

it's been a long time already, I think I did all the math in nodes 😄

devout quarry
#

same haha, just 1 big node outputting vertex pos/normals

fervent tinsel
#

if I remember right, I ported the graphs from some ue4 tutorial

#

ue4 materials are all nodes

#

or using those old catlikecoding tutorials

devout quarry
#

that article is good

#

high quality articles

fervent tinsel
#

there are some neato gdc talks about ocean rendering if one wants to dig further into this topic

devout quarry
#

I think you can get lost in ocean rendering haha

#

never ends

hearty wasp
#

so I've been trying to get this project from worldspace working as @leaden gyro tried to explain, but uhh

#

in the preview it looks fine

#

almost as if it projects from an angle?

#

I could almost rotate it and use it as a waterfall now lol

devout quarry
#

@hearty wasp use X and Z components

#

not X and Y

hearty wasp
regal stag
#

What you had before, but B going into the Y input rather than G

#

The split node uses RGBA, but it can also be interpreted as XYZW, so G=Y, B=Z

devout quarry
#

I should've said R and B instead of X and Z, my bad for confusion

hearty wasp
#

oh yeah, I see

#

sorry for asking so much stuff on here by the way, I swear I'm trying my hardest to figure stuff out myself first haha

#

it's kind of working now?

#

it's still not entirely working the way I intend, but I think that's because I'm plugging this into the wrong nodes

devout quarry
#

but the texture is not longer stretched?

#

should not be stretched if tiling.x = tiling.y

hearty wasp
#

it's not stretched anymore, no! thank you

devout quarry
#

cool

#

and don't worry, this channel is meant for questions about shaders 🙂

hearty wasp
#

I'm just trying to make sense of where to actually plug in the world space now

devout quarry
#

So you've taken the R/B (or X/Z) components of the world space position, and now you can use that vector2 as your UVs

#

so for example in a sample texture2D node, if you want the texture to be sampled using world space UVs, you would use those

hearty wasp
#

yeah, I thought I had it by plugging it into the two first offset and tiling nodes that I use

#

and it sort of works? but not quite

devout quarry
#

it looks fine I think, you put it in a tiling and offset node, and then in the UVs of the noise

hearty wasp
#

let me see if I can make a gif of this and keep it under 8mb lol

devout quarry
#

mp4 would result in smaller size I think

hearty wasp
#

aw, discord doesn't embed avi?

#

hold on

devout quarry
#

ah so it's not matching up?

#

not really sure why that happens

hearty wasp
regal stag
#

Hmm, if you're using world space uvs it should line up, that's one of the advantages of using it

hearty wasp
#

this should be more visible

#

yeah, I have absolutely no idea why it's not lining up

regal stag
#

Is this in URP or HDRP btw?

hearty wasp
#

LWRP

regal stag
#

Ah okay

hearty wasp
#

I guess that's the new URP now, no?

devout quarry
#

URP is the new LWRP

hearty wasp
#

right

regal stag
#

Yeah LWRP is the older versions

hearty wasp
#

but that shouldn't be much of a problem, right? I'm on 2019.2

#

I'm not assuming it's an unity bug at least

#

I'm probably just plugging in the world space projection into the wrong nodes if I had to guess

regal stag
#

Can you try a simpler setup with a single texture sample and no scrolling, see if that lines up?

hearty wasp
#

yeah, that does line up

devout quarry
#

I think your issue is you are modifying the world space UVs (tiling them) then using them

#

and so you are working with 2 sets of world space UVs?

regal stag
#

Looking at the video actually, you might be using worldspace UVs for the darker foam, but not for the white foam

hearty wasp
#

the top one are the normals, the bottom one are the ripples

regal stag
#

Yeah that tiling and offset node at the bottom doesn't have a UV input

#

So it's using the plane's UV0 channel instead

hearty wasp
regal stag
#

That's also a lot of tiling and offset nodes, you probably don't need that many

hearty wasp
#

you're probably right yeah

#

I got it though, it's working now

#

hm

#

this is what I did?

#

I removed that topmost tiling and offset one as well as it was indeed redundant

regal stag
#

You now seem to be offsetting the (worldspace) UVs by itself

hearty wasp
#

how would you suggest to do it?

regal stag
hearty wasp
regal stag
#

Uh no, I meant leave the UV input, but disconnect the "Offset" ones

#

If the bottom one always has a tiling of 1,1 you could remove that node entirely too

hearty wasp
#

ah alright, I understand now

#

thank you

#

I'm assuming having less nodes also just saves on performance, mhm?

regal stag
#

For inside the shadergraph editor, yes. For the final shader when rendering, I doubt more tiling and offset nodes will make much of a difference. It does "Out = UV * Tiling + Offset"

hearty wasp
#

right

regal stag
#

I guess having less operations is better though

hearty wasp
#

now I got my world tiling, I guess I can try foam around edges

#

how do I make those node groups? if they're called that

#

I tried googling it but couldn't find it

regal stag
#

I think it might only be in URP, but drag a selection, right-click and there's a "Group Selection"

#

The LWRP might be too old to have groups, can't remember when they were added

hearty wasp
#

heyy I have them

#

cool

#

thank you

ocean spade
distant pawn
#

I don't really know how tessellation works but I am guessing it may work under the context following: is it possible to have two shaders on one object. One of them a regular tessellation shader, and one a shader graph shader that displaces the mesh. Would they work together?

leaden gyro
#

@hearty wasp Awesome to see you got it working :D

When you guys were talking I was asleep, it was 12-2 in the night here

grand jolt
#

could someone help me with making an outline for sprites

hearty wasp
#

@leaden gyro its alright, and thanks for all the help to you and @devout quarry and @regal stag as well! Definitely inspired me greatly to continue with shaders

leaden gyro
#

@hearty wasp definitely my favorite part of Game Design

grand jolt
#

lol my outline is broken, rather than apply outside the character its applying inside

leaden gyro
#

What are you trying to do

#

I dont understand 'outline for sprites'

grand jolt
#

so it has the black line surrounding the actual sprite

leaden gyro
#

The easiest way to this is like this:

#

Take the sprite into a sample texture 2d
Take another sprite into a sample texture 2d
Change the scale via the UVs of the second sample
Now you have two different sized sprites
Use the second spirte as a mask so you can overlay another color on top of it
And use the bigger sprite as alpha value

#

I hope im making sense here, let me see if I can do this myself in a shader

grand jolt
#

the resize however for some reason still has the pivot on the bottom left

#

all the tutorials ive seen offset them a bit up down right and left

#

but that seems like a bit too much effort, especially once you are adding more and more sprites

#

also it's a bit "squarey" if you know what i mean

leaden gyro
#

Okay

#

Then make the second sprite as an ew texture in photoshop

#

*new texture

#

just use a smaller brush

#

make sure youre properly in the center

#

and tada you have one smaller particle

grand jolt
#

my sprite is 8x8 already though

#

the outline thickness would be 25% of sprite's size

#

hm, well I guess the only option left is resize it and add them manually

leaden gyro
#

There we go :p

#

Make sure you set the shader to Transparent and Alpha mode

#

You can do that in the master node settings

#

Ignore those red and green channels, Im recycling a texture I happened to have in my project

grand jolt
leaden gyro
#

Ohhhhhh

grand jolt
#

but this one is resized, which I'm trying to avoid

#

because then I'll have to scale everything accordingly so its proportional

leaden gyro
#

Hmmmm

#

Then I have no clue, I dont work with pixelart kinda things... if you find a solution though, id love to learn from it 🙂

grand jolt
#

oh

leaden gyro
#

I think that might prove useful. Something in the direction of using a Step node and overlaying that over the texture

grand jolt
#

I've tried following it but it was a little bricky

leaden gyro
#

bricky?

grand jolt
#

sec

leaden gyro
#

Im guessing the proper way to get this effect is to make a custom render pipeline feature which takes objects of a certain tag and then projects a outline aroundthose objects

#

but I have no clue as to how youd go about that

grand jolt
#

if im using this 4 offsets method then it becomes like this rather than this

devout quarry
leaden gyro
#

@devout quarry hwo do i access that

devout quarry
#

sorry

#

fixed

leaden gyro
#

Woah oh god, programming!

grand jolt
#

lol, that outline is more suitable for 3d projecs i think

#

i literally want just line on the perimeter

#

oh well, I think I'll just go with outlining them manually, feelsbadman

meager pelican
#

I was just going to say, why can't you just build the outlines into the spritebook versions? Would be faster too. And they'd look the way you want them to.

#

This kind of stuff is why there's such a high ratio of artists to programmers.

grand jolt
#

then its going to take up more memory

#

ah screw it, ima do that instead

#

too much effort to add outline shaders

#

oh wiat, but then i wont be able to adjust thickness

#

AAAAAAAAAAAA

meager pelican
#

You want adjustable thickness too? For 2D sprites?

#

Is this a special effect that gets turned on and off? Or just "contract coloring" for the sprites?

faint notch
#

If want outline in your corners cant you just modify the sprite shader, and make it draw a fatter copy with a fill color behind your textured sprite?

#

Yeah if your always going to have it on, you should just generate the outline with a tool - there is some available

grand jolt
#

I want to always have it on but with adjustable thickness/color

#

The only solution I've came up with is 8 offset copies

#

But that doesn't seem efficient

#

well actually not always on, toggle-able

meager pelican
#

Well then it's easy. Think color replacement instead. If you want it thinner, just use transparent on one set. It's pixel-art, right? So pixelated.

grand jolt
#

Yea, most sprites resolution are 8x8, up to 16x16

meager pelican
#

Use special colors for the outlines. But are you actually using those low-res textured? Or is that logical resolution?

grand jolt
#

I don't quite understand

#

The PNG image resolution is 8x8

#

But in game it's scaled up obviously

meager pelican
#

What's the color depth?

#

Do you want the outlines (at widest) to be beyond the 8x8 or 16x16 area? AKA it adds extra?

grand jolt
meager pelican
#

Yeah, but that looks the same width and height, but with an outline, right?

grand jolt
#

no, its bigger. the first one is 50x50, the other is 48x48 (resized x3 so i could draw the line manually)

meager pelican
#

Hmm.

OK, so you can select your sizes , and 50x50 works for you, instead of 48x48.

grand jolt
#

I mean, the sprite was originally 16x16

meager pelican
#

I know, but I'm talking about selectively replacing the outline. I guess it doesn't matter too much, if you want to intrude INTO the sprite with the outline.

But OK, what was the color depth? How are you doing the colors as far as the real storage, even if you only have 256 values used?

#

AKA what texture format?

grand jolt
#

yy how do I check that

#

oh i have it set as Automatic

meager pelican
#

You can see in the inspector.

#

What I'm about to discuss is that you build the outline, or outlineS into the sprite, but just don't display it if you don't want it there. ;)

It's the opposite of what you've been thinking...selective un-outline. You'd do that by selective color replacement or clipping. You'd have some value be "the outline" color or colors. Maybe you have two or three special colors as it gets thicker. Thickness types 3,2,1, 0 with 0 = no outline. And then you could swap in your variable outline color too. You'd build that into the sprite data.

#

And by "colors" I mean color values in the sprite data, not what is displayed (which could all be the same color).

grand jolt
#

Hmm

meager pelican
#

So basically, you construct the sprite like the fig on the left, and then the shader optionally makes it look like the one on the right, by not drawing that black outline that is a special-flagged-valued color. Or alpha. Or something.

Just a thought. And like I said, you can use several values for several thicknesses. 3,2,1 in my example.

devout quarry
#

@hearty wasp Just wanted to show what kind of distortion you can achieve with a few sine functions.

#

and it's really just 1 node you need, sure it uses a custom function but if you are somewhat familiar with some basic coding it will make sense

grand jolt
#

@meager pelican isn't it basically the same as replacing the sprite with the one that has an outline? Or does it add the outline

leaden gyro
#

@devout quarry Nice, put the sine functions into scale aswell

meager pelican
#

It subtracts the outline.

But you'd only need one sprite.

But sure, if you want to have 4 sprites, 0, 1, 2, and 3 pixel-thick outlines, and use a flipbook type of thing, fine too.

I guess the approach here is to put the outline mostly in the artist's control for what it looks like. Build the data into the sprite and then the shader can operate on it, rather than having it try to deduce what you would like to see.

grand jolt
#

Oh so the outline is built in but the shader 'cuts' it a bit

#

But what if I wanted to add the fadeaway glow on top of that

#

Kind of gradient-like

meager pelican
#

Right!

And how much gets cut depends on the values passed. And color could be substituted, for variable outline colors.

So if you use, say, alpha (not really recommended) as a "flag", alpha 255 (1.0f) is normal sprite stuff, alpha 0 is transparent, alpha 1 is farthest/thickest outline, alpha 2 is nearer, alpha 3 is right up-next.

#

Glow? Fade? New.

grand jolt
#

In this case the 'glow' is black

meager pelican
#

Is the shadow/glow all the same color? Maybe alpha faded. So in this case, black, with variable fade.

#

Does it change with outline thickness?

grand jolt
#

Adjustable color. (Hex value entered by player)

meager pelican
#

Yeah, but all the same for all pixels, right? Not counting alpha fade.

grand jolt
#

Uhm, yea I think.

#

Glow color independent from outline's

meager pelican
#

OK, How many colors in a sprite?

#

Not counting outline and shadow/glow.

#

Are you emulating a 256 color scheme or something?

tight forge
#

@regal stag Hi there, always enjoy following your tutorials. Big thanks for helping me learn a bunch of stuff! I was following your fog shadergraph post and I can't seem to get it working.

#

that's the graph. alpha clip is zero. all the nodes are attached as your post instructs afaik

#

Settings are set to depth texture enabled, i'm in Unity 2019.3.0f3 with SG 7.1.8

grand jolt
#

@meager pelican there are hundreds of different sprites, each has different color theme

regal stag
#

@tight forge What's the Fog Colour's alpha set to? (In both shadergraph blackboard and material inspector). Shadergraph defaults colours to 0,0,0,0, which can be annoying. It needs a higher alpha value otherwise it'll be fully invisible, unless you disconnect the Multiply with the Fog Colour alpha in the graph.

tight forge
#

thanks for replying! ah well that's the thing it was set to zero by default, and then I realised if i play with the alpha slider in inspector, something actually happens.

#

but the plane just looks like it's faded out, there's no 'depth' to the fog as your captures show

meager pelican
#

@grand jolt OK, but are they all from some palette? Or are they full RGBA values?

So just off the top of my head:
Color (0,0,0, non-zero & non-one) is transparent glow swapping glow color RGB values in.
Color (x,x,x, 1/255f) is the first outline level, swap outline color
Color (x,x,x, 2/255f) is the next thickness of outline
Color(x,x,x,3/255f)....
Color (r,g,b,1f) is the sprite "dot's" color.

regal stag
#

@tight forge The "depth/density" of the fog can be controlled by scaling the plane in the Y direction. It's a result of using the transform to object space.

grand jolt
#

Pretty sure it's rgba, I'm using asperite if it changes anything

tight forge
#

@regal stag omg. i see it now

#

i'm an idiot! thanks so much for clarifying!

regal stag
#

@tight forge No problem. And, you aren't an idiot. Perhaps my post isn't entirely clear about the scaling.

tight forge
#

Much appreciated, your twitter video does show the scaling, i just missed that because clearly i haven't had enough coffee yet.

devout quarry
#

In SG, what does this mode mean?

#

I found that it changes what pixel is read when I leave the texture slot blank

#

but what else would this affect?

#

And which one should I choose

regal stag
#

I believe it is just the default value for the texture

#

Like as you said, when the texture slot is blank

devout quarry
#

Allright! Makes sense for me to have it black by default so I wonder why the default is white

#

If I leave the slot empty, I think you would like to have nothing show up

regal stag
#

Hmm, I guess. I usually just leave it as white. I don't tend to not have a texture there. I guess if your texture is a mask for another texture you might want it to default to white for "no mask".

low lichen
#

The color is (0,0,0,0), so if the shader uses this alpha for transparency, it won't show anything.

regal stag
#

@devout quarry It's the same as when defining a texture property in code btw, like :
_Texture ("Texture", 2D) = "white" {}

For 2D Textures, the default value is either an empty string, or one of the built-in default Textures: “white” (RGBA: 1,1,1,1), “black” (RGBA: 0,0,0,0), “gray” (RGBA: 0.5,0.5,0.5,0.5), “bump” (RGBA: 0.5,0.5,1,0.5) or “red” (RGBA: 1,0,0,0). (from https://docs.unity3d.com/Manual/SL-Properties.html )

devout quarry
#

okay cool thank you

bold current
#

Hi!

I decided to learn the Unity shader graph. I've been trying it in both LWRP and HDRP. So I followed some instructions on how to make a dissolve shader. After making it in LWRP it worked fine (see screenshot link 1). But the same effect acts very differently and weird in HDRP (see screenshot link 2). Is there a workaround or am I not taking something into consideration here? (The HDRP shader graph is using HDRP lit shader as base. Tried using the LWRP pbr graph but the preview failed to work)

Screenshot 1 (LWRP result) https://gyazo.com/04fa63a63e95a0b90b85df8a1e23ed11

Screenshot 2 (HDRP result) https://gyazo.com/f3ff7268c735e6a46b523228355e4097

Screenshot 3 (LWRP shader graph following brackeys tutorial) https://gyazo.com/c364fe260b79b0da281cd2db04d1f733

Screenshot 4 (HDRP shader graph) https://gyazo.com/7246c9c35cbedc603c92fed5da6ab2c2

Note: Using Unity version 2019.2.19f1 for HDRP and 2019.2.17f1 for LWRP

#

I suspect this is a bug and unavoidable right now...

Edit: I disconnected and removed the emission effect to make the issue easier to spot, in case that seemed confusing to look at :P

sand wasp
#

Line renderers are infuriating me. I've got a fancy pants shader to light my line renders, only to be foiled because they are oriented to face the camera direction, not the camera position

brazen kernel
#

how can i get the reverse of the fresnel effect?

low lichen
#

@brazen kernel In Shader Graph or in code?

brazen kernel
#

shader graph

#

i tried multiplying it by -1 but that gave me some weird results

devout quarry
#

use '1 minus'

#

if you multiply by -1, the black parts that are 'zero' will still be zero

#

so you won't get the desired effect

#

but if you use the 'one minus' node, 1 will be come '1-1 = 0' and 0 will become '1-0' = 1

leaden gyro
radiant rain
#

Is there any way to put emission in 2d shadergraphs?

distant pawn
#

I seriously can't remember how to make a seed work with the shader graph gradient noise node. What's the node setup again?

regal stag
#

@distant pawn seed? Are you referring to the Random Range node not gradient noise?

distant pawn
#

no. With the gradient noise, I seem to remember there was an arrangement of nodes that ported into the UV input that allowed you to pick were on the Gradient noise you started (a seed) via a Vector2.

regal stag
#

Ah okay. You can offset the UVs with a Vector2 to obtain a different section of the Gradient Noise. The Tiling & Offset node can help with that (or just an Add/Subtract).

distant pawn
#

ok. thx

#

that Add did it thx

sand wasp
#

So, I'm doing some shader stuff with line renderers, and as far as I can tell the normal vectors they are generating are completely wrong.

regal stag
#

@sand wasp I take it you have the "Generate Lighting Data" enabled on the LineRenderer?

sand wasp
#

I do

#

I don't know what it is with line renders, the way they align with the camera is just... kinda funky. Like, you keep the camera in one place and rotate it and they ever so slightly twist

#

I hate these things, the documentation says they try to face the camera, but it's like a combination between trying to face the camera and trying to face the camera direction. Unlike particle systems they don't have a bucket of different render alignment settings.

regal stag
#

Can definitely see what you mean. The generated normals look more like an average of the view direction more than actual normals

sand wasp
#

It's kinda infuriating

#

I guess there's a reason I never see anyone light these things

neon gull
#

you can calculate normals either by using a geometry shader or by using ddx/ddy in the fragment shader

#

in both cases you need a cross product

#

and the world/object position of 3 point on your surface

sand wasp
#

ddx/ddy?

distant pawn
#

is there a way to share a gradient noise texture (that is generated by the Gradient Noise node in shader graph) with a script?

#

or any other way to sync up Unity's Mathf.PerlinNoise and the Gradient noise node. Gradient textures don't work due to them not syncing up for some reason

meager pelican
#

It depends on what EXACTLY you want. Unity's gradient is pretty diverse with lots of points for evaluation and abrupt changes.

What I usually do is use Unity's gradient color tool, and decide on a "resolution"...such as 1024 steps. Then I create a 1024x1 texture, and fill it in with the gradient results by evaluating the gradient with a for loop and setting the texture accordingly.

Then set it in the shader(s) and then just use a texture sampler to sample it with a "UV" of x = point, y=0.

Noise is the same thing, but 2D. So evaluate it and generate a texture. Don't use the "math" based ones in SG. Generate one yourself, and it will "sync up".

#

Basically, drive it all from C# and just sample. Auto-sync.

They even give you some sample code here if you want:
https://docs.unity3d.com/Packages/com.unity.shadergraph@7.1/manual/Gradient-Noise-Node.html
You could use that and convert it to c# if you wanted. Or just use what's on C# side and make your textures. I suppose the sampler could skew the results slightly depending on settings. So you may have to play with lerping in C# to get it close. Or do your own node and do the same equivalent code on each side.

Basically, I'm saying you're going to need one authoritative side. Or some very careful custom code on both sides that produces the same result.

neon gull
#

@sand wasp Basically what it does is it gives you the derivative of a specific attribute in the fragment shader (for example world position) to the current fragment's neighbouring pixels. So by taking the derivative of the position in x and y direction you could calculate the cross product between them to get the normal of your surface

sand wasp
#

I'm no stranger to dirivatives, I'm calculating normals in tangent space via shadergraph in this example

#

but tangent space seems to be funky with line renderers

vapid turret
#

How do you zoom in shader graph?

#

On a laptop

noble tree
#

scroll, probably

#

normally 2 fingers up or down on the trackpad

high scarab
desert orbit
high scarab
#

Thank you :)

vapid turret
#

So the new PBR master node has 3 new values, Vertex Position, Vertex Normal, Vertex Tangent. Since I move my object with the Transform Node, should I connect this node to all the 3 above or the Vertex Position only?

devout quarry
#

Using the transform node you should transform to object space

#

And put it in the vertex position slot

#

that's if you're only moving the object

#

if you have your own normals you want to use, also transform them to object space but set the transform node to 'direction' instead of 'position', then plug it into vertex normals

#

The custom function node gives me an offset and some normals

#

normals are transformed to object space, using direction type, and put into vertex normals

#

position is transformed into object space, using position type, and put into vertex position

vapid turret
#

Oh my god you are amazing @devout quarry

#

Well I am using the normal quad so I don’t think I have my “own” normals correct?

#

So it is safe to just plug it into Vertex Position and leave the rest?

devout quarry
#

Yeah should be

vapid turret
#

Thank you very much!

devout quarry
#

It's only if you're moving the vertices in a shape like a wave or something that you would be changing the normals

#

Since lighting has to behave differently

vapid turret
#

I am kind of scaling them

#

Like from 0 to 1

#

And normal move with Lerp from one pos to another

#

Also @devout quarry any idea why the new gradient doesn’t have a middle slider? Like it has 2 only

#

It used to be 3

devout quarry
#

New gradient?

vapid turret
#

The gradient variable I mean

#

In the blackboard where you add your variables

#

You can add a gradient

devout quarry
#

I've never used one there sorry haha

#

You got a picture?

vapid turret
#

Yeah sure one min

#

Never mind I double clicked and it popped XD

#

Thanks man 🤣

frigid harness
#

Hello , How can I apply gaussian blur to a texture 2d? Is it possible?

mental bone
#

hey there I'm trying to use the Fog node in shadergraph but with a unlit master node. While the unlite master is active density always returns 0. If i set a PBR master to be active then the density returns correct values. Anyway to get it working with a unlit master node ?

wicked estuary
#

Hi, can anyone help me with displaying my camera depth texture (so I can see it with my own eyes on the screen)? I tried the following

  1. Create a second camera that outputs to a render texture, but I can't seem to control that it outputs the depth texture
  2. Create an unlit shader graph with a Texture 2D node that references _CameraDepthTexture -> Sample Texture 2d -> Albedo on my master node and then assign that to a material -> plane
#

Oh I also tried without 2 and simply changing it to a Transparent graph and set the AlphaClipThreshold to 0

neon gull
#

Do you want to do it by writing the shader for it yourself or do you want to use shadergraph?

wicked estuary
#

Shader Graph (or if it's possible to simply have a camera display it on a render texture)

#

It's not really for anything practical other than being able to visualize a depth texture while learning about these things

neon gull
#

ohh

#

in that case you can simply use the frame debugger

wicked estuary
#

I basically just want to see this

neon gull
wicked estuary
neon gull
#

are you using hdrp, urp or the legacy pipeline?

wicked estuary
#

URP

neon gull
#

okay give me a sec i have to check the draw calls in urp cause my project is hdrp

wicked estuary
#

my camera is orthographic, if that matters

#

I know it would matter if I wanted to use the Scene Depth node to do stuff, but not sure it matters if I simply want to view the camera depth texture with my own eyes 😄

#

slowly working my way to understanding how to use scene depth in a shader to do things like fog or water color based on depth

neon gull
#

Alright so here's what you have to do

#

make sure depth is enabled in the settings of your urp asset

#

Open the frame debugger afterwards, select the depth prepass group and if you want the result to be greyscaled instead of red you have to select channels R instead of All

#

The result should look like this (or red if the channel is not set up properly)

wicked estuary
#

and the frame debugger is available in the scrub version of Unity? 🙂

low lichen
#

Sure, basically everything is except dark mode and some Unity services

wicked estuary
#

dark mode.. I'd pay $50 just to get that 😉

#

I run everything with dark more, except unity .. gnahh 😄

#

@neon gull hmm so it's all red.. but I'm sure it's enabled

neon gull
#

can you send an image?

wicked estuary
neon gull
#

I mean an image of the result (the red one) 🙂

wicked estuary
#

and I'm using the high quality setting

#

if I change my camera from Ortographic to Perspective, it turns completely black instead 😄

neon gull
#

okay, it might just be because of the far plane distance, you can either try lowering that one (i think it's 1000 per default) or you can try this slider up here to change the range

devout quarry
#

You see the effect right?

#

It's just using the red channel

wicked estuary
#

in my scene I have a plane (as a background) with simple gradient shader

neon gull
#

that plane has the same distance to the camera for every pixel, thus the depth texture has the same color everywhere

#

The reason it is red is because depth uses only one texture channel (in this case the red one)

devout quarry
#

But you see the scene in the texture right?

#

It's not just 1 color

neon gull
#

if there are no objects with another depth than your plane you won't see a lot of stuff

wicked estuary
#

it's a solid red

devout quarry
#

It's not

wicked estuary
#

see the screenshot above

devout quarry
#

Yeah I see the screenshot

#

it's not solid red

#

I see a shape

neon gull
#

"okay, it might just be because of the far plane distance, you can either try lowering that one (i think it's 1000 per default) or you can try this slider up here to change the range"

wicked estuary
#

oh you're right

neon gull
#

just try this and you should be fine

devout quarry
#

If you want to convert it to black-and-white though, which should make it more visible, you can do that using a screen space shader

wicked estuary
#

I did try changing that level but it had no effect

devout quarry
#

and sample the red channel of the _CameraDepthTexture

neon gull
#

try changing the left side of that slider to something higher

#

@devout quarry it's not a custom shader, just a buffer from the frame debugger

wicked estuary
#

there we go 🙂

#

Cheers lads 👍

#

I wouldn't mind learning how to do it with a shader just as a learning thing

devout quarry
#

Yeah I know it is @neon gull , I'm just saying how you could change it so you can see it in black and white

#

@wicked estuary give me a few seconds I'll show you, URP right?

wicked estuary
#

Yep ❤️

#

not a fan of just dragging stuff into the editor and getting the effect, I'd rather spend some time to learn the things that makes it tick

neon gull
#

i could send you a sample project i made for a course at university, the effect the shield has on the pillar works identical

#

it's not urp though

#

but the logic behind the shader is the same

wicked estuary
neon gull
#

Haven't really seen any of brackeys videos yet and don't have a lot of experience with shadegraph but from the thumbnail I'd say it's the same concept

devout quarry
#

Like this right?

wicked estuary
#

exactly like that

devout quarry
#

I have some extra diagrams too that might help you

#

This is the code for that depth effect

wicked estuary
#

@neon gull I'm slowly learning to "speak 3d space" .. I've mainly focused on 2d before and then I didn't really think much about near/far planes, clipping space etc 😄

devout quarry
#

So basically we sample the _CameraDepthTexture, and we take the red channel (.r) because as you saw depth was encoded in the red channel

#

I also divide by a distance property just so I can control the effect

wicked estuary
#

whew.. shader language 😉

#

Yep 🙂

devout quarry
#

this might help you too

wicked estuary
#

I figured

near space = the nearest distance from the camera that objects will be rendered
far space = furthest distance from the camera that the object will be rendered
the cone that they form = frustum

I think 😄

devout quarry
#

That's what I think too 🙂

#

I have something else hold on

wicked estuary
#

and "clipping space" is vertex positions "as seen from the camera" i.e where the cameras view space has it's own coordinates that are different from world space

#

again.. I think 😉

devout quarry
#

This is specific for water but it's the same concept as your force shield

wicked estuary
#

ok so looking at the Screen Position.. I was skimming those docs before

Default

Returns Screen Position. This mode divides Screen Position by the clip space position W component.

Raw

Returns Screen Position. This mode does not divide Screen Position by the clip space position W component. This is useful for projection.

devout quarry
#

yes!

wicked estuary
#

what is " clip space position W component"

devout quarry
wicked estuary
#

again clipping space is "as seen from the cameras lense"

#

what's the W component ?

devout quarry
#

here is info about the W component

#

please be aware that this is from my personal notes, so grain of salt

#

but this is my understanding

#

so the w component is the depth, but relative to the camera

wicked estuary
#

ok.. so x, y, z are simply the position relative to the camera lense.. W is sort of the difference (substract) betweeen the objects world space Z and the objects clip space Z ?

#

or.. hmm

#

yeah.. so W is in fact the distance between the worldspace Z of the camera and object ?

#

@devout quarry do you think that's an accurate description of W?

devout quarry
#

'w' is 'object depth'

#

So distance between camera and object yes

#

I'm no expert though so I hope other people read this but that's my understanding

#

But important to note that this is camera relative!

#

Important to consider that when working on effects or shaders that use it

#

Especially when your camera is very close to your objects

#

Because then, the distance between camera and object can change vastly based on camera orientation

#

If your camera is far away, this effect is less strong

wicked estuary
#

Yeah but it can't just be the distance from the camera to the object thought? Wouldn't that be Z ?

#

hmm no if it was Z then would assume my camera was placed dead infront of the Z axis.. whihc it might not

devout quarry
#

Hmm no

#

Because camera near plane

#

Is not same as camera position

#

And clip space depth is relative to near plane

wicked estuary
#

ah so z,y,z is relative to the nearspace and w is the distance from the actual camera itself

#

w = z + near plane ?

devout quarry
#

I think so yeah , that would make sense to me

#

Clip space is between near and far plane so definitely relative to those planes

#

But also I do think the orientation of the vector is different

#

Because w component right

#

Is relative to camera

wicked estuary
#

and distance W is measured from the actual "lens"

devout quarry
#

So you can imagine a vector from camera to objecy

#

And z component is vector between near plane and object

wicked estuary
#

and W would be the magnitude of that vector

devout quarry
#

And those two vectors are not parallel if you know what I mean

#

Yeah so w is a line between camera and object

#

And z is line between near plane and object

#

But those two lines are only parallel when the object is at the center of the camera view

#

That's my understanding

wicked estuary
#

yeah that'd make sense since they start from different locations

devout quarry
#

Yeah and also like

#

'w' is a distance between a point and a point right

#

So that's just by doing a straight line from point A to B

#

But 'z' is distance between point and plane

wicked estuary
#

yeah the magnitude of the vector that is formed between those two points

devout quarry
#

And for that, you need to take a line that's orthogonal to that plane

#

That's definition of distance between point and plane

wicked estuary
#

So the difference when using an orthographic camera is that depth is normalized

devout quarry
#

Not 100% sure on that sorry

#

Cyan has some tweets on that

wicked estuary
#

Yeah I found his blog yesterday and been skimming it 🙂

devout quarry
#

This link I mean

wicked estuary
#

found the thread on the water shader on orthographic camera

devout quarry
#

Ah cool!

wicked estuary
#

so with a perspective camera and Eye scene depth.. W is the actual distance in units

devout quarry
#

Meters yeah

wicked estuary
#

while linear would normalize that between near and fare plane

devout quarry
#

But

#

There is a difference between scene depth and the w component of screen position

#

Scene depth will disregard transparent objects

wicked estuary
#

yeah because they're not rendered to the CameraDepthTexture

#

since they're at a later stage of the render pipeline.. only opaque objects are added to the depth texture ?

devout quarry
#

Scene depth is linear or non-linear depending on the mode you use, and distance is between 0 and 1 or in world units, relative to camera

#

Yeah that's the deal with 'forward' rendering I think

#

Opaques first

#

Then transparents

#

And so depth texture is generated inbetween

#

You can see this in frame debugger!

wicked estuary
#

Scene depth is linear or non-linear depending on the mode you use, and distance is between 0 and 1 or in world units, relative to camera
I think it's more like

linear = 0 to 1 starting at the near plane and ending at the fare plane
eye = world units starting from the camera

devout quarry
#

Yeah

wicked estuary
#

and raw is .. umm.. 0 to 1 starting at the camera (and not the near plane) ?

devout quarry
#

I'm not too sure about that

wicked estuary
#

or it's simply the alpha of depth texture

devout quarry
#

I think so!

#

It's the value of the depth texture yes

#

But so it's 0 at near plane I think

wicked estuary
#

I really appreciate that you guys let me bounce my vague understandings of these things to help me solidify them 😄

regal stag
#

It's 0 to 1 at the near/far planes, but isn't linear like Linear01 depth

#

e.g. A value of 0.5, won't be half-way between the near/far plane

wicked estuary
#

oh looks it's @regal stag himself! 😄 Love your blog.. lots of goodies for a shader n00b like myself

devout quarry
#

Cyan if you see a mistake in my screenshots, let me know

regal stag
#

Thanks 🙂

devout quarry
#

But afaik they are correct

wicked estuary
#

@regal stag so how is 0.5 "determined" in a raw sample ?

devout quarry
#

This explains it

regal stag
#

Yeah, so if you sampled the texture and got a value of 0.5 back

wicked estuary
#

Depth precision is a pain in the ass that every graphics programmer has to struggle with sooner or later.
Glad it's just not me 🤣

regal stag
#

I still don't know if my understandings are fully correct tbh

devout quarry
#

Lol fair

#

I've never had any formal education on this so never 100% sure

#

Only know things from personal research online

regal stag
#

Same, self-taught

wicked estuary
#

trying to wrap my head around where, in depth, 0.5 could be in a raw reading if it's not guaranteed to be in the mid-point between the near/far planes 😄

meager pelican
#

.w is the perspective divide. And it's going to be different for ortho, because ortho's perceptive is different. That's how I think of it. :2c:

regal stag
#

Yeah, in ortho the w component should be 1?

devout quarry
#

Think so

wicked estuary
#

because in ortho everything is the same distance from the camera?

regal stag
#

Yeah

meager pelican
wicked estuary
#

more great reading material! Lucky I have 64gb ram with all the browser tabs I have as a backlog of things to read 😄

devout quarry
#

All this stuff is really interesting

wicked estuary
#

@regal stag so wait.. it's for "Screen Positions" that W is always 1 for ortho, but "Scene Depth" still has a value right ?

regal stag
#

Correct

meager pelican
#

I seldom have to worry about it, since it's usually done in hardware anyway. By the time it gets to the frag() function, it's been done.

The hardware needs to know so it can do early-z tests.

And it starts as a 1 in the vert (at least for normal 3d perspective) if you're generating your own clip-space in the vert.

Z is still there in clip space, and gets divided, yeah.

regal stag
#

The Scene Depth node in ortho mode should be set to Raw though, as it already is linear

wicked estuary
#

Yes

#

I'm looking at this from your tweets

#

Is Position (space = view) the same as Screen Position (but with a twist or you'd used the latter 😉 )

#

@regal stag ☝️

regal stag
#

Uhh no

#

At least I don't think so, I'm not entirely sure tbh

meager pelican
wicked estuary
#

Trying to understand why you are using Position (with Space = View) and not Screen Position (i.e as seen from the camera)

#

I get that this part is simply to get the depth in the correct Z orientation

#

and for testing purpose (on a single platform) all that can be replaced (right?) with just Scene Depth (Raw) node

#

@meager pelican does that last post explain "Space = View" in the Position node in Cyans sample?

#

and.. no u still need to Lerp between the planes

#

as a way to convert it to units

regal stag
#

Yeah it should help explain it, at least a little. The Screen Position is the normalised device coordinates, so it's different from eye/view space

wicked estuary
#

my head is exploding 🤯 lots to wrap your head around when learning it from the start 😄

regal stag
#

Ah yeah, that article is fairly good for explaining the different coordinate spaces

wicked estuary
#

umm so View space is sort of a "raw" view from the cameras point of view .. the space ranges from -1 to 1 ? then when we move into clip space, we're in the space that's created when the View space is "clipped" by the area defined between the near and far planes? and those coords range from 0 to 1 ?

regal stag
#

The view space is like world space but relative from the camera. I think.

#

since world space is the step before view

meager pelican
#

NDC/View/Clip/Screen spaces. Giving CG people headaches since conception, along with quaternions.

Note that OpenGL and DirectX have some differences.

regal stag
#

Haha

wicked estuary
#

World space = position in the entire world
View space = position relative to what I can see "from my eyes/camera"
Clip space = position relative to what I can see from my eye/camera while viewing it through a frustum

?

#

@meager pelican let's not go there 😉 currently my 3d world is all normalized to unity on windows with an nvidia card 😉

#

is that a fair approximation of the different spaces?

regal stag
#

Uh, I think so

wicked estuary
#

And what ranges are they operating in?

World space = positive/negative infinity
View space = positive/negtive range depends on the cameras fov?
Clip space = ?

regal stag
#

The view space doesn't really have limits, it's just a rotated/offset version of the world in a way.

#

I think the clip space is the one which beyond -1 to 1 is clipped away.

#

at least for OpenGL

wicked estuary
#

right so it's basically the same space, just as seen from the camera where the camera is the new 0,0,0 ?

meager pelican
#

Well, clip space is about "what's in the frustum". It ranges from -1 -> 1.0 with 0,0 being in the center. Z is depth of some sort.

So anything outside of -1, 1 ranges are "clipped" as part of the rasterization process. Now dealing with Z and W gets complicated, and that's where you have to dig into the links and see the differences. And also ortho = messes with my head. NDC and Clip aren't exactly the same thing (again, see link)

regal stag
#

@wicked estuary Yeah

wicked estuary
#

guys, you're literally saving me days here ❤️

regal stag
#

The transformations between spaces is done by the difference matrices.
Object to World uses the "model" matrix.
World to View uses the "view" matrix.
View to Clip uses the "projection" matrix.
Clip to normalised device coordinates (aka Screen Position), divides Clip by Clip.w ("perspective divide")

meager pelican
#

The main thing that I remember is that the vertex shader outputs clip space stuff. The hardware knows how to do the perspective divide to get to the frag shader, and you have to set W properly in vert().

So after all that ^^^ matrix math, vert outputs clip-space.

I think.

regal stag
#

Yeah, a vertex shader should convert from model to clip space and output the clip space position. It then does the perspective divide between that and the fragment shader.

wicked estuary
#

Clip to normalised device coordinates (aka Screen Position), divides Clip by Clip.w ("perspective divide")
But only when using Screen Position with Default, with Raw you're still staying in Clip Space since it doesn't divide by W ?

regal stag
#

Correct (at least that's my understanding of the Screen Position node)

wicked estuary
#

So as a silly example.. I can create a simple shader that lerps between two colors based on the screen position (raw) X position .. so when the object is far left of the cameras view it would be Color 1 and on the far right it would be Color 2.. in the middle it would be an equal blend ?

meager pelican
#

Which is why the ztest thing in hardware is so cool.

If you get what it is doing, you realize that the frag() shader isn't even called for frags that fail the z-test (this is what I mentioned earlier for "early z testing")

wicked estuary
#

like so

meager pelican
#

I'd do it in vert() on the clip-space position, with a formula, and let the interpolators mess with the color value, rather than worry about the x pos in the frag/screen-space.

But sure. You can view many values "in color"...common debugging technique, you just remap them somehow to colors.

wicked estuary
#

@meager pelican I'm not quite at the HLSL level yet so my brain isn't thinking in terms of vert() or frag() just yet 😄

#

that shader kinda helps to illustrate clip space quite well when u move it around in world space

#

I noticed that if I dragged my plane along the Z axis, the color changed

#

but then I realized that's because that translates to a change in X in clip space

#

hmm I just noticed that that shader only works with an orthographic camera

#

if I change it to perspective then it turns red

#

well sort of.. it fades if I drag it to the edge

#

ohh.. the type of Screen Space matters here.. changing it to Default makes it work in perspective

#

so this has something to do with that perspective divide thing

regal stag
#

Yeah, well for orthographic, the Raw w component is 1, the perspective divide won't do anything in that case.

wicked estuary
#

so is the perspective divide something like "flattening" our the positions in relations to the distance from the camera

#

sort of translating them to a single plane ?

#

if that makes any sense.. I don't even know anywhere 😂

regal stag
#

It basically pulls positions towards the screen center, it's what handles the actual perspective projection

#

But yeah, objects at a further distance have a higher w value, so get pulled in more

wicked estuary
#

so an X position close to the camera is the same as an X position far away from the camera.. i.e their clip space X are independent of perspective of which they're viewed

#

horrible way of explaining it, I know 😉

#

it takes the perspective out of the equation so to speak ?

#

Ok here goes.. both quads are placed on the same world space X but due to the perspective they are at different clip space X coords.. by dividing with W that difference is eliminated, giving them the same clip space X ?

#

@regal stag did I get that right? 😄

regal stag
#

I'll be honest I'm getting a little confused at this point

wicked estuary
#

😆 sorry 😉

regal stag
#

Haha it's okay, it's not you. Trying to understand all these coordinate spaces can just be somewhat confusing in general.

wicked estuary
#

but yeah I think that make sense.. they are rendering using the same color at those positions and they would only do that if they were returning the same screen positions

#

since the colors are lerped based on X screen cord

#

and we can clearly see that they're at different RAW X clip space coords

#

so I think that's fair enough approximation of what it means to divide by W in clip space

#

hopefully one I can live with until a tiny detail completely messes things up when I try and do something and will have to get an 100% accurate understanding 😉

#

@regal stag I'll re-read your fog shader breakdown tomorrow morning to see if my new insight into spaces increases my understanding of the techniques used 😄

devout quarry
#

If I have 4 vector1 properties

#

is it better, performance-wise, to put them into 1 vector4 and then access the properties using xyzw?

#

And if this is the case, at what point does it reduce performance? Because I could start putting properties into matrices?

devout quarry
#

And one other question

#

This is what I get with this graph

#

So using the vertex colors as color

#

but when I take split the vertex colors vector4 and use the R channel as color

#

I just get a white plane

#

instead of what I expected (black plane with white where I painted the red vertex color)

regal stag
#

If the other vertices on the plane have a white vertex colour, that is going to include a R component of 1 as well as the red area itself.

devout quarry
#

Ah that makes sense

#

So default is white?

regal stag
#

You would have to set all the other vertex colours to black if that's what the output you expect is

#

I think the default tends to be white yeah. I guess it might depend on what modelling software the model is made in. I know blender at least defaults to white.

devout quarry
#

Okay thank you

#

Kind of annoying though, if I want to use a channel as a mask, I can't just start painting right away because every vertex already contains that color?

#

I need to 'clear' the paint first

meager pelican
#

@devout quarry Depends, on if they're uniform, or if they get passed vert->frag or what. One (a bit older) video from a GPU maker I saw said in essence "try to limit your interpolation to 4 float4's max for performance". You'll see the Unity shader code often "packs" things into float4's too for the "v2f" stuff.

And matricies and other data are often passed as constant buffers for the frame, or uniforms on the shader, or whatnot.

Memory access and alignment is often best by forming sizes (say of structuredBuffer data) of sizeof(float4) as I guess memory is most efficiently accessed that way, or in multiples that amount to that.

is it better, performance-wise, to put them into 1 vector4 and then access the properties using xyzw?
And if this is the case, at what point does it reduce performance? Because I could start putting properties into matrices?```
meager pelican
#

Oh, and if you can do one operation on them (say adding 1 to all of them) then by all means VECTORIZE them. Vector ops usually happen in one institution. SIMD type of thinking.

devout quarry
#

Ah interesting stuff

#

So like for a wave

#

I should put the characteristics in a vector4 all together

#

let's say (speed, wavelength, amplitude, steepness) or something like that

meager pelican
#

A lot of this stuff is hardware and engine dependent.

Unity makes "blocks" of data to pass up to the GPU when needed for many things. Hence the term Material Property BLOCK for example when dealing with instancing.

For a vector4 vs 4 floats...I'd assume one call to SetVector is faster than four calls to SetFloat. Just less function call overhead. But who cares unless you're doing 1000's of them?

For uniforms, IDK.

The engine guys would have to pipe in for more details, and/or to correct me. Maybe others know more.

The thing is that shaders are limited by "vector register pressure" too. So there might be a point of diminishing returns, and in fact it may all vary depending on the compiler and the optimizations that it does. I just know some "general rules" and I let the engine do its thing.

fossil cedar
#

Hi. i've been using shadergraph mostly writing HLSL into custom function nodes as a sort of visual shader prototyping environment which i find very a powerful tool, however ideally i would really like to render the results of the shader graph directly into a Texture2D or Texture3D, to have multiple buffers and feedback, etc. which as I understand would require a new Shader Graph type. I'm using HDRP but i've heard the URP may have some functionality related to this? or is anyone aware of a RenderTexture ShaderGraph already being on Unity's roadmap?

#

you can also see my recent messages in #✨┃vfx-and-particles for a use case and some backstory but it's not purely related to that use case, this is something i've been meaning to dive into ever since shader graph was announced as a viable workflow (though it's currently not very as its not shader graph's most essential use case, i.e. defining surfaces / materials similar to a digital content creation suite.)

#

though I am hopeful for conveying the importance and usefulness of this feature. Take this as step further into the concept of a compute shader graph which would be amazingly powerful and educational for many as well.

fervent tinsel
#

but like, should be able to author CRT compatible shaders and use the generated CRT on HDRP shaders / shader graphs still

#

Amplify Shader Editor also has node graph support for CRT's I think, but it's 3rd party solution

#

some LWRP SG's also worked on that CRT but I never had success with HDRP ones

#

(and once you compile generic PBR Graph on HDRP, it stopped working on CRT when I tested it)

#

it's probably not a big difference and I never really investigated what breaks it on HDRP shaders but point is, you can still author things for it manually

#

that uses LWRP unlit SG to feed CRT

fossil cedar
#

i found that repo also, but haven't cloned it yet

#

thats the LWRP / URP wacky workaround i heard about.. you install URP, create the shader graph asset, then uninstall URP and install HDRP lol

fervent tinsel
#

well, that's probably my comment on that thread

#

basically it breaks the moment you compile the shader without LWRP/URP installed

#

if you have both LWRP/URP and HDRP installed at the same time, I managed to make it work

fossil cedar
#

aha, that's hacky but makes sense

fervent tinsel
#

there's basically something missing form HDRP unlit shader, so if it generates it for LWRP/URP, it's still comptible with CRT

#

I haven't checked what it needs, like, if it would be possible to fix with simple change on the generated HDRP shader

#

and if it would be something Unity woud be willing to include on stock HDRP

#

because it sure would be handy to have

fossil cedar
#

right, exactly i think we can get it on the roadmap / backlog at least if it isn't already

fervent tinsel
#

do note that I haven't checked how this works on recent Unity and HDRP versions

fossil cedar
#

no worries

#

i ought to just file a bug report

fervent tinsel
#

you could yes

fossil cedar
#

" works under URP but not HDRP, reproducible" 🤠

fervent tinsel
#

just make sure you have a repro that's super easy to replicate

#

if you attach simple repro project, your chances on getting anyone to figure this out get way better odds

fossil cedar
#

yeah good point

fervent tinsel
#

I'd assume otherwise it'll just end up on the backlog

#

also should make sure it really breaks on most recent HDRP as well

#

hmmm, wonder if I still have my HDRP port for that project somewhere

#

could test it easily I suppose if it's still there

#

found it, altho I dunno if this had everything upgraded to HDRP yet

#

this was for 2019.1 / HDRP 5.16

#

but I'll just upgrade it to 7.1.8

fossil cedar
#

i also found LG electronics actually forked HDRP 5.1 and made their own custom render texture shader graph

fervent tinsel
#

really?

#

any source?

#

link etc 🙂

fossil cedar
#

i got it to compile in HDRP 7.1 but i gave up trying to get the shaders its codegen spits out to compile lol

fervent tinsel
#

I mean if it's not a big change in the stock shaders, it's not really that difficult to mod either

#

main issue with these is that you can't just extend HDRP to use new shader template like you can with ASE

fossil cedar
#

because LG's approach was either a bit hacky or it didn't uses some code gen util libraries that unity refactored a bunch of shader graph code into

fervent tinsel
#

so you gotta modify the whole HDRP which is then pain to maintain

fossil cedar
#

but the code is on github and can be used as an example case to Unity

#

i'll link u soon on my phone rn

fervent tinsel
#

tbh, I have a feeling that CRT shouldn't even work with LWRP/URP unlit, but it just does 😄

#

if you look at the CRT docs, you should use shader specifically meant for it

#

* #include “UnityCustomRenderTexture.cginc”

    Use the provided Vertex Shader InitCustomRenderTextureVertexShader

    Use the provided input structure v2f_init_customrendertexture for the pixel shader
#

docs have been wrong in past tho

fossil cedar
#

right and that was written before SRP was really officia i think? but cant have been that long anyway i think Custom RTs were released in 2017 but for built in / legacy pipeline

fervent tinsel
#

if I remember right, you can't just go including that cginc on HDRP shader either

#

legacy shaders includes usually break in all directions with HDRP shaders

#

I don't think SRP shaders have ever meant to support CRTs

fossil cedar
#

right though i could try in a custom function node, they support includes.. but maybe only applies to the scope of those custom functions

fervent tinsel
#

you can still technically run the old shaderlab shaders for CRTs even on HDRP

#

it's just, would be nice to be able to author the shaders in SG

fossil cedar
#

right yeah that's the idea, since its so useful

#

and i have no problem with doing it all in code but i interface with many artists and it's very powerful to make abstracted tools for them and myself to approach design iteratively.

#

the domain specificity of shader graph and visual effect graph is powerful as well for those domains but it's also significantly limiting versus a general purpose node graph paradigm

fervent tinsel
#

still seems to be no-go with unlit graph and HDRP 7.1.8

fossil cedar
fervent tinsel
#

I'll try hacking that URP to compile the shader

#

thanks

#

how did you find that? 😄

fossil cedar
#

i have a hacked up version i grafted some of HDRP 7.1 into and the graph UI works but the shaders it generates don't compile and realised we'd be better off forking HDRP 7.1 from scratch to add new shader graph types

fervent tinsel
#

yeah they moved the SG templates elsewhere I think

fossil cedar
#

yeah though it also has a bunch of codegen they seemed to have moved to a reusable library with some pretty funny abstractions lol a template factory if you will

#

it makes sense though, building powerful directed node graphs tend to go this way

fervent tinsel
#

I really wish they would let you just do this on actual project, instead of having to modify the HDRP

fossil cedar
#

yeah, they are adding more and more injection points for HDRP so i see that as a possibility

fervent tinsel
#

there's really no custom SG work done afaik

#

like you can do custom passes and pp passes

#

but only thing I know is that they are working on custom pass graph

fossil cedar
#

right though whatever refactor happened under the hood should make it better than when LG did it in 5.1

fervent tinsel
#

you can use SG's to some extent already with current HDRP's custom passes

fossil cedar
#

the templates have significant fat trimmed but even the unlit sg template is still massive to account for so many shader variants

fervent tinsel
#

I could look into porting this into HDRP master at some point as I'd really love to have this.. it's just I don't look into maintaining this so it's bit too early to do it now 😄

fossil cedar
#

yeah i wanna see what unity devs will say first

fervent tinsel
#

yeah, it's kinda bummer we don't have any really working feedback solution for requests like this

fossil cedar
#

if they are planning to release this in 2020.1 or 2 anyway then why waste our time

fervent tinsel
#

and this is a regression essentially

#

I bet they are not planning it 😄

fossil cedar
#

yeah those are the magic words though

#

reproducible, regression, there's gotta be one more...

#

really useful? lol

fervent tinsel
#

currently trying to get URP compile that unlit graph on that project now

#

it still kept putting on HDRP despite I was running on URP asset

#

just wiped library to enforce it 😄

#

still hdrp shaders...

#

I wonder if this is somehow enforced at asset level now

#

in the older SRPs SG's, you could even swap the SG master nodes from the graph

#

I don't think that's possible anymore

#

btw, I'm trying to interpret that LG repos license

#

it sounds like they claim all rights for their modifications

#

I dunno if SRP's license even allows them to do that

fossil cedar
#

yeah, fortunately it's garbage code already

#

but is still useful as a reference/ proof of concept

fervent tinsel
#

I dunno, only thing worth anything there is the template

#

technically one could mod URP template too, as it's supposed to work

fossil cedar
#

right it's more like, ok Unity obviously an important company like LG wanted this so much they had some engineer waste their time forking HDRP to do it

#

so can you pretty please put it on the roadmap for 2020? owo

fervent tinsel
#

people have requested tessellation graph and terrain graph for years already

#

and those are obviously way higher prio things

#

but obviously still low prio things as we don't have them 😄

fossil cedar
#

aha but this is a very active time of development and like you said technically a regression

fervent tinsel
#

technically it also still works with the manually authored shaders 😄

#

you have your 7.1 port public btw? or just locally done it?

fossil cedar
#

which are barely supported in HDRP, shader graph is the #1 way they want shaders to be written in HDRP

fervent tinsel
#

I'm mainly interested which all files you need for SG side of things to put a new graph type nowdays

fossil cedar
#

and this is a pretty easy use case to understand

#

@fervent tinsel its garbage i hacked together quick and idk if i'm allowed to make it public anyway. but message me if you want to chat about those details specifically

fervent tinsel
#

I'll look around first

astral pecan
#

So I am using this to change my Shader Graph material property.

materialBlock = new MaterialPropertyBlock();
materialBlock.SetFloat("_CoverVariation", Random.Range(0, variationDepth));
meshRenderer.SetPropertyBlock(materialBlock);

Its a simple float variation
But I get this in the frame debugger.

Non-instanced properties set for instanced shader

It says it cannot be batched because of this
Am I using material property block wrong? Why can't it be batched?
I thought anything except for Textures can be changed safely with material property block for it to be batched?

stone sandal
#

shader graph properties are not currently compatible with material property block

distant pawn
#

is there a way to share a shader graph node value (e.g. a gradient noise node) with a script in realtime

#

cause I need to get the Gradient noise as a texture for my script

distant pawn
#

or at least, is it possible in regular shader code?

fervent tinsel
#

@fossil cedar I did get that thing ported to latest github HDRP/staging (using it from 2020.1)

#

and it does work

#

just redid the graph using clean CRT graph and hooked it into CRT on that snow track demo project

#

there's probably still tons of things done wrong but at least it works

fossil cedar
#

@distant pawn reading values from the GPU (shader / HLSL) to the CPU (C#) can be tricky and has caveats, but not impossible. you typically want to keep things a one way street.. CPU -> GPU -> Display. But there are plenty of use cases for doing otherwise, like general purpose GPU compute with compute shaders, etc. Yes, It's possible and better at the moment to do this sort of thing with "regular" written shaders at the moment if needed. Or if you can get around it and just use some noise functions for C# that would be better assuming you don't need massive parallel processing

#

@fervent tinsel you mean you the URP trick with the Unlit ShaderGraph? or you implemented a Custom RenderTexture ShaderGraph ?

distant pawn
#

@fossil cedar would there be any documentation on it?

fervent tinsel
#

I ported the CRT Graph

#

I think subgraph support is still partially broken

#

because once I moved something from main graph to subgraph, this thing completely broke 😄

#

it does seem to work with one main graph still

fossil cedar
#

okay well like i said i had trouble with it as well but at least you got some shader to compile at all from it

fervent tinsel
#

yeah, I swapped to new shader includes

#

plus had to update ton on the cs files

#

but there's obviously still some things wrong on the subshader part 😄

#

I'll see if I can redo this from scratch at some point

#

now at least I have some idea how this is setup

fossil cedar
#

@fervent tinsel yeah I think I was close i was just trying to get the surface description struct and the includes sorted out in the generated shader and was like enough for tonight after pouring through so many thousands of lines of C#. Thanks for looking into it anyway, I'm glad it piqued someone's interest.

#

@distant pawn Here's a pure C# / CPU method to generate values from a perlin noise gradient. I'd scroll down and use the one dimensional version if you just need one value or a few: https://docs.unity3d.com/ScriptReference/Mathf.PerlinNoise.html
Or if you really need to read back to the CPU with C# from a Texture2D on the GPU, (presumably a render texture with the result of some shader,) you might use this or one of the methods mentioned in this doc:
https://docs.unity3d.com/ScriptReference/Texture2D.GetPixel.html

fervent tinsel
#

the main issue when dealing with stuff like this is that you end up going to the undocumented part of the SRP and there's a lot of things to figure out if you really want it work perfect

#

I wish we engine users would get at least some google docs etc design docs for these systems, or some notes

#

but the current stance seems to be that only public API needs documenting for end users

fossil cedar
#

I assumed Unity has plans for that but they are waiting for development to slow down enough they they don't have to rewrite the docs every month

#

2020 seems like a good year for it though

fervent tinsel
#

I'd expect at most some technical talk about specific systems, like we've seen so far

fossil cedar
#

they must have some internal docs though like you are saying, something rough in a shared internal document

fervent tinsel
#

they have plenty of those as they are often linked on SRP PR's

#

it's just they are not public for all

fossil cedar
#

oh yeaaah i do remember coming across those private doc links on github before

fervent tinsel
#

also lol @ that LG 3rd party license file. They got GPL licensed stuff there... which is direct conflict of most other licenses they have there

fossil cedar
#

it is a bit ironic that those docs are private, while there has been this whole initiative to share source of all the new packages, and SRP... those docs are relatively useless on their own, yet they would probably add a significant amount of value to the code

fervent tinsel
#

to be fair, there would only be limited amount of users who'd actually want to modify the stock SRPs

#

and I can imagine studios that do mod them have paid support from Unity so they get access to the info they need directly

fossil cedar
#

yeah, most probably have an engagement with Unity already

#

and yeah i mean honestly who knows if LG even wrote that Custom RT shadergraph code, they maybe lifted it from somewhere else or it's something they paid a Unity dev to throw together custom one day for all we know

fervent tinsel
#

as for the CRT thing, I can DM you my current changes (if you want them that is), I dunno when I'll have time to properly do this

#

I'm fairly certain those fall under that Unity companion license anyway

#

the reason I even looked at this is because I do need this for my main project eventually, it's just been on my backlog for ages with low priority

#

I was actually going to go with ASE route but having SG support would be nicer

mental bone
#

hey there I'm trying to use the Fog node in shadergraph but with a unlit master node. While the unlit master is active density always returns 0. If i set a PBR master to be active then the density returns correct values. Anyway to get it working with a unlit master node ?

leaden gyro
#

Need really quick advice for Shader Graph

#

If Im using a mask to change normals

#

What node should I put into the rest to get the original normals for the rest of the mesh

mental bone
#

do you mean the mesh normals or a normal map ?

leaden gyro
#

Mesh Normals, but I think I already got it, the 'Normal From Height'node seems to do the trick

mental bone
#

for mesh normals you should use the normal vector node no?

wicked estuary
#

@regal stag @meager pelican the coin dropped on why things are divided by W. Make objects further away, from the camera, to be pushed towards the center hence creating the perspective

mental bone
#

so anyone have any ideas on my Fog node problem

kind helm
#

Does having separated nodes from anything else affect performance in the shader graph?

#

Like having a noise node but it's not attached to anything

low lichen
#

@kind helm I highly doubt it, but you can always check in the generated shader code.

mental bone
#

@kind helm as far as I know and by looking at the generated code if the node does not lead to the active master node it does not affect performance. Not sure if gets generated into the code, it used to.

kind helm
#

Okay thanks!

lone stream
#

can someone give me an advice on how to generate tileable procedural texture using RT or CRT?

meager pelican
#

@distant pawn <sharing data> I already answered that for you. And some of @fossil cedar 's post just said the same thing. Drive it with known values from C# and use your own funcitons. You can't expect SG's functions to be the exact same math functions as in C#'s "gradient" and "noise" functions.

YOU supply the functions and data. Then YOU will get the same outputs for the same inputs. You have to have an authoritative source of data.

What part didn't/don't you understand on this? Confused here.

You're not going to get SG's library to guarantee that it produces the same results as C#'s library for all noise functions. PASS THE DATA from one or the other (C#->SG is easiest).

Or write your own math-based funcitons on both sides, and hope the floating point math is so standardized that it "works out" (doubt it).

#

In real-time or in an editor?

lone stream
#

both

meager pelican
#

Oy.
In an editor, you can "chop" up any texture, and reorient the pieces to get a tileable texture. The way that is done, is to cut it down the middle horizontally and vertically, and swap corners, and fixed up the new-middle. I suppose you could project points mathematically to do that too. But "fixing up the middle" might be tough.

#

That works because what was the center becomes the outsides...so they "tile" seamlessly. But the new-middle gets messed up.

Basically, it's a symmetry problem, so if you could mathematically make it generate things symmetrically in the quad-divisions of the texture, it will tile. You can probably find some algorithms if your google fu is strong. But I can't help further, maybe someone else has a ref.

tall chasm
#

Hello, under LWRP there is an unlit shader. It does not have an option to rotate the sprite. Does anyone know how to do it?

wicked estuary
#

the sprite? do u mean the texture?

tall chasm
#

@wicked estuary I'm so confused. let me print screen

wicked estuary
#

so the texture

tall chasm
#

I'd like to be able to rotate it. So I went ahead to make a shader graph

wicked estuary
#

do u need to color it as well, or just take a texture and rotate it?

tall chasm
#

Which is done under Create > Shader > Unlit Graph
But this is how it looks like. I don't know why it's empty. Shouldn't it default to have the options like in the LWRP Unlit?

#

I'd like to have the same surface inputs as in LWRP Unlit but with the extra rotate ability

wicked estuary
#

ok

#

so in shader graph u have the "blackboard" .. u can open it in the top-right corner of the shader graph window if u dont have it opened

#

anything in your blackboard can be exposed as a property

#

that's what it looks like empty

tall chasm
#

Ok

wicked estuary
#

say I have this simple shader

#

notice that I have a Texture 2D asset in there

#

but it's an inline property now

#

if I right click on that and choose Convert To Property then it will be moved to my blackboard

tall chasm
#

Let me try it

wicked estuary
#

u can give it a name there and make sure that the Exposed property is checked

#

save your graph and it should now be available on your shader in the unity editor

tall chasm
#

What is the difference between Sample Texture 2D Lod vs non Lod?

wicked estuary
#

sorry I was meant to use the non-LOD in my sample

tall chasm
#

Ahh ok

#

When do we use this Lod version?

wicked estuary
#

LOD is "Level of Detail"

#

u know how u can adjust the level of details in games depending on your graphics cards power etc

#

control how much detail is displayed etc

tall chasm
#

Ahh ok I understand Lod now! Thanks 🙂

wicked estuary
#

now sure why your master looks different, maybe different URP versions? I'm pretty new to all of this myself 😄

#

there u can see the rotation in effect

#

I added a rotation property that you can control

#

the rotation property is simply a Vector1 which u can think of as a float

tall chasm
#

Bookmarked the link. Gonna read it before bedtime
Hmm... I guess that's the reason but nevermind that

#

Hang on still working on the graph

wicked estuary
#

@meager pelican in view space, where is (0,0,0) located? Right at the cameras position? Or is the X & Y at level with the camera and Z=0 is actually where the near plane is ?

#

@regal stag oh guess I can ask you since you're here 😄

regal stag
#

Those LODs are more for object/mesh levels of detail. The LOD in sample textures is more to do with choose mipmap levels, where you can choose the mipmap level, while in the normal Sample Texture 2D node it handles mipmaps for you. (Smaller blurred versions of the image, less detail at a distance).

tall chasm
#

When I apply my texture it turns pure white lol

#

my texture has transparency

wicked estuary
#

did u change that on your master node?

tall chasm
#

yup. same thing

wicked estuary
#

odd, works just fine here 🙂

#

although i didnt try it with a transparent texture

tall chasm
#

This is with the default unlit

#

normal texture work fine too but not transparent one

wicked estuary
#

might need a lit texture to set the alpha though

regal stag
#

If you want to replicate that, the master node needs to be set to Transparent in shadergraph, otherwise alpha won't be taken into account (unless you use alphacutout/clipthreshold that is).

tall chasm
wicked estuary
#

oh u need to hook up the alpha edge as well

#

drag the A from the Sample Texture to the Alpha on yoru master

tall chasm
#

ITS WORKING!!

wicked estuary
#

that's with a transparent texture that's been rotated

tall chasm
#

Sorry I was happy lol

wicked estuary
#

Cool!

#

@regal stag in view space, where is (0,0,0) located? Right at the cameras position? Or is the X & Y at level with the camera and Z=0 is actually where the near plane is ?

tall chasm
#

Let me try out tiling and colour myself and get back to you

wicked estuary
#

tip: color = take sample texture output and multiply with a color

#

tiling is straight forward

#

@tall chasm let me know if u get stuck. I added color and tiling to my version

regal stag
#

@wicked estuary I assume it's at the cameras position. I think the near/far planes are probably included in the projection matrix conversion to clip space, as then it clips outside the viewing frustum based on the near/far.

wicked estuary
#

yeah that makes sense.. anything between the camera and the near plane, after converting to view space, will be clipped

#

so if (0,0,0) is as the base of the camera, there's a dead zone between the camera and near plane

regal stag
#

Was trying to find this page yesterday, it has some good images

wicked estuary
#

Thanks, will brew some extra strong coffee and get reading 😉

regal stag
#

But yeah, any objects between the camera and near plane won't be rendered. That happens in clip space though, not view

wicked estuary
#

yeah

tall chasm
regal stag
#

The inspector views Vector2/Vector3 properties as Vector4's, you can ignore the other components

#

Or if you want, you can combine your two Vector2 tiling and offset into a single Vector4, with the XY components as Tiling and ZW components as Offset. (Then in shadergraph you'd need to Split the Vector4 and put the correct components into Vector2 nodes though).

wicked estuary
#

@tall chasm yeah that's pretty much identical to what I ended up with

tall chasm
#

Awesome! But I dont understand why vector 2 property is showing "Z" and "W"

#

@regal stag Ahh ok I understand now!

#

@regal stag @wicked estuary Thanks a lot for the help!

regal stag
#

It's because there isn't a "Vector2" property in shaders, it's just a "Vector" which has 4 components. In shadergraph we get versions of these, but Vector2/Vector3/Vector4 will all be considered "Vector" properties. The "Vector1" is different though and is converted to a Float property.

tall chasm
#

@regal stag Ok that makes sense

wicked estuary
#

@tall chasm happy to be able to pass on my limited shader graph knowledge to a fellow learner 😄

tall chasm
#

I really appreciate it man 🙂

wicked estuary
#

making a tower defence game?

#

can't tell, from that perspective, if it's a turret or a tank

tall chasm
#

@wicked estuary haha kinda. More on survival tho. Building turrets is one of the thing in game

meager pelican
lone stream
#

ooh i should check that out

meager pelican
#

@wicked estuary I think z=0 in clip space is the near-plane. Screen Space is 2D with a depth buffer. But for View space....that's "just" camera relative space, and I think Cyan is correct. IDK for sure, since I seldom deal with it directly, but putting z=0 in view space might clip it because it's too close to the camera and the near-plane is further out.

#

Because in view space the camera is at 0,0,0

wicked estuary
#

👍

mortal sage
#

Hi. Tessellation in Shader Graph: will this be a thing (any time soon) ?

devout quarry
#

Not soon

#

But eventually I guess 🙂

mortal sage
#

ok. thx 🙂

leaden gyro
#

Yeah big pain in the ass that they havent done this yet :/

#

Also today I found out that you cannot use a texture to mask anything that goes into position

#

However, this was on 2019.2.15 so it might have been fixed by now

#

I ended up doing it via vertex painting

regal stag
#

Do you mean sampling textures for Vertex Position?

leaden gyro
#

No

#

It was a test in class, we had a model, and had to do different effects on different parts of it

grand jolt
#

Hq trivia

leaden gyro
#

So I made masks for each on the sections in Substance Painter, black and white masks

#

when I plugged the mask into T of a Lerp node, it could no longer be plugged into the Position

#

But when I used a vertex color channel as a mask in T of the Lerp node, it did work

regal stag
#

Yeah but, were you using Sample Texture 2D?

#

Because only the Sample Texture 2D LOD version can be used in the vertex stage of the shader

leaden gyro
#

Yes I was using that! I noticed when I pulled out of the Lerp and tried to make a texture node, only the LOD was an option!

#

So why is that?

stone sandal
#

because of mip mapping

#

in hlsl the standard sample function has a dynamic mip level but the vertex shader requires static values of the mip level, which the sampleLOD function lets you declare once

leaden gyro
#

Cool, my teacher didnt notice that issue, so I'll teach him something next time I see him

#

So if I had used the LOD Sample Texture, it would've worked fine?

stone sandal
#

yep, that can feed into the vertex slots with no issue

leaden gyro
#

Awesome, thanks!

stone sandal
#

it does also point this out on the documentation pages for those nodes

#

i know the discoverability of docs isn't great at the moment, but it is there 😅

leaden gyro
#

Oh the documentation of Unity is pretty good, better than Unreal

It just didnt even occur to us to look at the documentation of the Sample Texture Node. We thought it was just a strange limitation.

#

The documentation is often a little too confusing for me though, since it is written very technically. Since I dont know the backend of shaders that well, it can be difficult to decipher.

stone sandal
#

luckily shader graph is just a visual abstraction layer of HLSL, which is pretty extensively documented and discussed

#

if you have any issues with the shader itself you can google "hlsl + [issue query]" and usually get the shader-level explanation

leaden gyro
#

It'll be difficult to read, but I suppose I'll learn more from it. I'll give it a try next time.

#

Programming really isnt my forte

wicked estuary
#

and shader programming is on another level of complexity than "normal" programming 😄

fervent tinsel
#

@mortal sage you know the workarounds tho?

#

altho how usable they are depend on your application

#

you still can feed stock HDRP tessellation shader data through render textures which you can modify runtime

#

we just had lengthy disccusion last night about getting CRTs working on HDRP

#

(custom render textures)

fossil cedar
#

@fervent tinsel maybe something possible there not sure how convoluted that would be in regards to tessellation shaders and what performance drawbacks there might be... @mortal sage currently i'd just skip shadergraph if you need tessellation.
Interesting thing is Mesh Shaders were just announced to be added to DirectX to replace the decade old Tessellation and Geometry shaders so it would make more sense for Unity to add Shader graph support for that at this point

fervent tinsel
#

you'd need DX12 for the mesh shaders tho, right?

#

it's quite niche audience then

#

I guess that really boils down if both upcoming consoles support that

devout quarry
#

in SG, what is the difference between the normal and the vertex normal slot?

stone sandal
#

vertex x slots happen in the vert() function of the shader, the other slots happen in the frag() function of the shader

tall chasm
#

Hello guys, tiling doesn't work with transparent sprites?

mortal sage
#

@fervent tinsel @fossil cedar Thank you I'll have a look into these things. This is for a quite complex custom terrain shader done in shadergraph, I am trying to figure out what would be the best way to add displacement. Maybe parallax occlusion mapping will fit better but it makes the graph much heavier

fervent tinsel
#

not sure if tessellation would be any cheaper

#

I also wonder what's the deal with the tessellation graph being issue as the change between HDRP Lit and HDRP Tessellation shaders is mainly just tessellation properties, two includes, few pragma changes in general + 2 extra pragmas per pass

#

it seems so simple so wonder why they don't do it