#archived-shaders

1 messages ยท Page 86 of 1

reef grove
#

it would make sense if I was adding to the color, the color would be added multiple times but

#

yeah this makes no damn sense

#

oh my GOD i dug up something

#

i guess

#

I dont really know what to do about that because theres nothing else that will work

#

postprocessing isn't what I want because I need the effect to be material dependant

#

I guess i could make a fragment shader that calculates lighting manually? I dont really know how to do that

meager pelican
reef grove
#

this is what the shader does, its two tone with a dither in between

#

I just need it to work with multiple lights and shadows, which it almost does

#

except for the artifacting

#

I could achive that with a postprocessing shader, but I would also like the "light" color to be material dependant

#

I would need some sort of pass or buffer to hold just the color of the material

#

maybe I can use srp? I honestly don't know much about it

strange basalt
#

would not need fully custom SRP could be render features ontop of URP

copper falcon
#

This is AC Mirage: the metal gate uses one texture that contains

  • trimsheets that are used for basically all surfaces ( green arrows)
  • details with alpha/cutout that are layered on top of these trims

Source: https://www.artstation.com/artwork/Za9A51

How is that done in a single shader pass? Some second-UV? Can faces have multiple UVs?

Share your wisdom!

ArtStation

During the development of AC Mirage i was responsible of making two of the doors for round city of Baghdad.
Khurasan Gate, Damascus Gate and the textures for the golden dome of Khufa.

Art Director - Salomรฉ Strappazzon

Art Director - Nikola Stoyanov
https://www.artstation.com/niko_stoyanov

Iana Pencheva - Lead Environment Artist
https://www....

low lichen
copper falcon
# low lichen How do you know it's done in one pass? I don't see anything in the post making t...

I made a very bold assumption ๐Ÿ˜„

There are multiple ways to create those visuals, and having a second pass that is alphaclipped or alpha blended would be among the worst performing ways to do that.

So there are multiple interpretations of this

  1. these is a smart way to do that that i do not know of yet because these experts at ubisoft know more than i do
  2. it may be done in the "not so smart" way that i know works

If it's just 2) so be it, but if it's something better, i would want to know that.

regal stag
regal stag
#

If they were flat, then yeah you could use multiple UV channels. Though that means sampling each texture twice

strange basalt
lament scarab
#

What could cause this shader to be fine in Unity but look super off in WebGL, kinda of a fisheye lowres effect
Tried messing with playersettings without luck

Shader "Hidden/Portal"
{
    Properties
    {
        _MainTex("Texture", 2D) = "white" {}
        _CameraViewport("CameraViewport", Vector) = (0, 0, 1, 1)
    }

    SubShader
    {
        Tags { "RenderType"="Opaque" "Queue"="Geometry" }
        Cull Back
        ZWrite On
        ZTest On

        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag

            #include "UnityCG.cginc"

            struct appdata
            {
                float4 vertex : POSITION;
            };

            struct v2f
            {
                float4 pos : SV_POSITION;
                float4 screenPos : TEXCOORD0;
            };

            v2f vert(appdata v)
            {
                v2f o;
                o.pos = UnityObjectToClipPos(v.vertex);
                o.screenPos = ComputeScreenPos(o.pos);
                return o;
            }

            sampler2D _MainTex;
            float4 _MainTex_ST;
            float4 _CameraViewport;

            float4 frag(v2f i) : SV_TARGET
            {
                float2 uv = i.screenPos.xy / i.screenPos.w;
                uv = _CameraViewport.xy + (_CameraViewport.zw * uv);
                return tex2D(_MainTex, uv);
            }
            ENDCG
        }
    }
}
lament scarab
#

Editor

candid bane
#

can you use texture arrays in unity without writing custom shaders?

dim yoke
lyric copper
#

I have what I hope is a simple question. I have created a shadergraph for a world space grid. The goal is that the gird is always in front of the player but ignores rotations on the x and z. This This works but the Position > World or Abs World space causes stretching when rotating the quad this shader is applied to . Is there a way to eliminate this stretching?

steady rose
#

Imagine I have a Render Texture file, assuming there's only black and white color between 0 - 1. When I use color masking and crop the black part, there's a slight black color between 0-1, however this only works if I check mark the Alpha Clipping. I'm using Sprite Unlit and using material in UI, how to solve this issue so I can remove all black color from texture?

amber saffron
# steady rose Imagine I have a Render Texture file, assuming there's only black and white colo...

Color masking (if you're talking of the color mask node in shadergraph) "detects" colors that are close to a certain target. If in your 0-1 range the color is to far away from the target, it is expected that it is not masked, and that include the sub pixel sampling of the texture : if one pixel is black, and the one beside is full white, and that you use linear sampling, in betweek you will get a grey color.

hollow swift
#

Is there a way to make shader graph write to a render texture? I want one shader to function as a mask, similar to a stencil buffer.

fair jackal
#

thanks for this btw! I think it's gotten pretty close, I did have to 1- the red value for some reason but otherwise seems to be working close enough

lyric copper
#

To simplify things I am simply attempting to project the grid texture over an object and not matter how I rotate the object the grid textures projection doesn't change. As if it is fixed in the world.

amber saffron
amber saffron
hollow swift
lyric copper
fluid peak
#

special connection type between nodes... ๐Ÿ˜‰
if theyre positioned "just" right

amber saffron
lyric copper
#

Here is the grid. There is a hole that is in object space that shows a hole. Sorta like a vignette effect

amber saffron
lyric copper
#

doesn't the position node set to World or absolute world project on all 3 axis?

#

I didn't split the output of the position node. Where did I make this mistake

amber saffron
#

You can see that from the color change on the connection (from yellow to green)

lyric copper
#

ahh ok I see what you mean

#

so do I split it to use x n z and plug that into the tiling and offset node?

keen sable
#

I'm looking for a shader (I think?) that I want to place on my Player game object that pulsates lightly. When the player dashes I want it to have a bit of a ghost effect (think Super Metroid/Street Fighter/Symphony of the Night but in 3D). Anyone have a recommendation on how to go about it? Should I just look for a 3rd party asset or are there good methods for this within Unity?

amber saffron
lyric copper
#

never even heard of it

amber saffron
lyric copper
#

looked up the swizzle node and applied it and it gives me a single axis

amber saffron
lyric copper
#

I am missing something. Its all distored with "xz" and with xy it distorts when I rotate my camera to look around

amber saffron
lyric copper
#

The lines are distorted and facing angled crazy

amber saffron
lyric copper
amber saffron
# lyric copper

Ok.. So, from the nodes setup I see, it should be a XZ world grid (projected vertically)
But you are applying it to a plane that is almost vertical, so the projection mostly fails.

Are you maybe tring to do a grid that displays "on" your environment ?

lyric copper
#

Yes

#

The grid should display over top of everything but leave as small adjustable circle opening

#

That circle acts as like a flash light in terms of it goes where I look

amber saffron
# lyric copper The grid should display over top of everything but leave as small adjustable cir...

But follow the other objects shape, right ?

Ok, then you have to do some adjustments.
In you current setup, the "position" node, set in world space, is giving you the current pixel position of the quad mesh, not other objects.
You need a way to get the position of what has been rendered before, and you have 3 ways to do this :

  1. Set the shader to "transparent" material type. Recreate the position from depth (using the scene depth node, a quick google search should give you nodes setup for this), and use this recreated position to draw the grid.
  2. Change to use a post process target in your graph, and make this a post process, where the position node will automatically calculate position from depth for you.
  3. Make it a decal shadergraph, that draws a simple grid and can be projected on objects
crisp python
#

Hi everyone, i dont know shadersalmost at all. I downloaded this, a glass shader, how do i use it or make it useable? I know materials and you drag it which is what i did with previous shaders

lament scarab
#

I think my issue might have to do with UVs

#

Read somewhere about clamping but doesn't seem like that applies 1:1

reef grove
#

oh

#

yeah this might be just want i need

#

wait

#

is this just a post processing effect

#

i think ill need more than that

#

i could use a post processing effect but i would also need to be able to put some extra information into a buffer

strange basalt
#

its more then post processing

#

lets you define whole render passes where you just do what ever you want

#

that can include rendering objects into a buffer of your choosing to use later

#

and you can choose when the pass happens

#

@reef grove ^

reef grove
#

so can i have a pass after each object does its lighting pass?

summer path
#

why does my shader look like this and i cant edit the values at all ?

#

its been a while since i messed with shaders so ive forgotten how to fix this

#

inside it looks like this

#

there's very little so idk why its bugging out

regal stag
#

As for the graph itself, you likely want to use the A output of the texture sample for the Alpha

regal stag
reef grove
#

oh shit

#

thats actaully great to know thank you

#

is there a way to make a shader file for urp? that lit.shader u shared isn't quite working and I thought maybe its a different version

regal stag
#

There isn't a urp-code template under the create menu as it's more recommended to use shader graphs for SRPs

reef grove
#

mmmm I like code better

#

also I already wrote most of it

#

guess its not the end of the world

summer path
#

nvm i got it

#

i cant believe i forgot about this

#

ty

reef grove
regal stag
# reef grove wait would I be able to do this with a graph? or

Might be possible in the "Unlit Graph" if you use Custom Function node to call that UniversalFragmentPBR(..) function that calculates the shading. But kinda complicated.

You can still use actual code files but it needs to be vert/frag style shaders not surface ones as those only function in Built-in RP. Easiest way to obtain a "template" for that would be to copy the shader file under Packages/Universal RP/Shaders (from the Project window) - though that code does tend to be quite lengthy as it contains passes for shadows, depth/normal texture creation, etc.

reef grove
#

cool

#

kinda silly that visual scripting is the "only way" if it doesn't have all the functionality

#

I dont know urp has always been a bit of a bother for me honestly

#

some things are just inexplicably harder

#

for example I have yet to find an ambient occlusion that looks as good as the one with built in rp

reef grove
#
_Dither ("Dither", 2D) = "white" {}
        _LightColor ("Light Color", Color) = (1,1,1)
        _DarkColor ("Dark Color", Color) = (0,0,0)
        _Bias ("Bias", Float) = 0.5
        _LightThreshold ("Light Threshold",Float) = 0.75
        _DarkThreshold ("Dark Threshold",Float) = 0.25
#

I have it in properties

#

what gives

#

hmm is it something to do with CGPROGRAM

#

seems not

#

ok I put it in the LitForwardPassDither.hlsl

#

seems to work

#

now I needt o get the screen position

regal stag
# reef grove I can't figure out how to declare variables ``` sampler2D _MainTex,_Normal,_Dith...

Hm, I think that should work but ideally you'd copy the LitInput.hlsl include as well so you can put them with the other properties (except textures) inside the CBUFFER_START(UnityPerMaterial) block. Mostly to keep the shader compatible with srp-batching

URP also has macros for textures, such as TEXTURE2D(_TextureName) and separated samplers SAMPLER(sampler_TextureName). Then sampling with SAMPLE_TEXTURE2D macro instead of tex2D, see LitInput.hlsl for example

reef grove
#

how come?

#

anyway I can't find my properties in the inspector and im not sure how to get screen position in here

#

this is rather complicated lol

#

ok I just removed the custom editor first problem solved

#

got it working!!!!

#

holy shit thats amazing

snow depot
#

Hey does anyone have any knowlege in how to make shadow volumes like Doom 3? It's really hard to find a straightforward answer that doesn't get super vague and technical online. I don't know like anything about shaders or lighting but I need to get this working for a project c_suicry

kind juniper
snow depot
kind juniper
snow depot
#

Nah I know how it works I just don't really know how to do it in practice. The light source basically finds the silloute of the object facing it then gets the vertexes of that silloute and casts them backwards, creating a volume which casts everything inside it into shadow.

kind juniper
snow depot
#

I believe so yes.

kind juniper
#

Well, you'll need a way to generate the silhouette then. One way I can think of is by checking each vertex normal against the light direction to only pick vertices with orthogonal to the light normals. With this you'll get the outline of the mesh from the light perspective. Then extrude all the vertices along light direction. Then render the silhouette with a shader that would write to stencil. All of this should be done before the objects are rendered normally. When you render the objects normally, you should check the stencil to apply your shadows(or avoid applying lighting).

#

The edge detection would probably need to be a bit more sophisticated to avoid artefacts

#

But to be honest, the whole process is gonna be quite expensive performance wise. Especially if you generate the silhouettes on the CPU and have many/compels meshes that need these shadows. You might be able to get a very similar effect with high enough shadow map resolution, which should be a lot lighter on performance.

snow depot
#

Maybe. But I am trying to recreate a very specific aesthetic from games like Doom 3 and F.E.A.R. so doing the same thing they did is a pretty good way to reach that. Plus because I'm aiming for that 2005ish style a lot of my assets are lower fidelity. Still I might have to fall back on that if I can't manage to actually build a working shadow volume script.

tacit parcel
tacit parcel
hollow swift
# amber saffron It's a shadergraph target :

Thank you. I still cannot figure out how to connect the two. Ofc I can input the shader and then see all the passes. But how would I create a custom pass in shader graph? Also I don't see any updates on the custom render texture that make sense tbh, its just all 1.

amber saffron
hollow swift
amber saffron
#

Isn't it there ?

hollow swift
#

Nope, I only have URP and Built-In there

#

Unity 2021.3.8f1, URP 12.1.7

#

Maybe I'd have to update my unity version then.

amber saffron
#

Sorry, I thought this target was implemented sooner than that :/

hollow swift
#

I think I'll try solving it with a RenderFeature then. I think that should work too if I can get it to work. Don't worry, very grateful for your help!

grand jolt
kind juniper
kind juniper
grand jolt
#

unity kills it when it's default value

kind juniper
grand jolt
#

apparently, it was this one's fault... there was no URP there earlier

hallow void
#

I have a shader with 3 layers of colors, when you clean with a hose the different layers come out. The PC worked perfectly but in the VR build it doesn't do anything. Does anyone know what the problem could be?

lament scarab
leaden radish
#

hey i don['t the see the production ready shader graphs in my tab m using unity 2022.3.26 LTS

amber saffron
sinful copper
#

Anyone know why shadergraph node previews just randomly fail? They don't work unless I close and re-open the shader. I'm on Unity 6.

lament scarab
#

Hi, I have this shader that breaks when HDR is turned on in WebGL, thoughts on how I could change it to support HDR?

Shader "Hidden/Portal"
{
    Properties
    {
        _MainTex("Texture", 2D) = "white" {}
        _CameraViewport("CameraViewport", Vector) = (0, 0, 1, 1)
    }

    SubShader
    {
        Tags { "RenderType"="Opaque" "Queue"="Geometry" }
        Cull Back
        ZWrite On
        ZTest On

        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag

            #include "UnityCG.cginc"

            struct appdata
            {
                float4 vertex : POSITION;
            };

            struct v2f
            {
                float4 pos : SV_POSITION;
                float4 screenPos : TEXCOORD0;
            };

            v2f vert(appdata v)
            {
                v2f o;
                o.pos = UnityObjectToClipPos(v.vertex);
                o.screenPos = ComputeScreenPos(o.pos);
                return o;
            }

            sampler2D _MainTex;
            float4 _MainTex_ST;
            float4 _CameraViewport;

            float4 frag(v2f i) : SV_TARGET
            {
                float2 uv = i.screenPos.xy / i.screenPos.w;
                uv = _CameraViewport.xy + (_CameraViewport.zw * uv);
                return tex2D(_MainTex, uv);
            }
            ENDCG
        }
    }
}
cyan spire
#

I have this simple rotation shader but I want the rotation to stay the same regardless of the object's Y rotation. Could anyone help? I am trying adding world positions and translations for hours but can't figure it out ๐Ÿ˜ฆ

tacit parcel
hallow void
ornate crypt
#

Hey, i'm trying to do a unlit URP shader, which has to display a 2D grid of a defined size (not a square), and the size of each cell is 1 unity unit by 1 unity unit. However, i don't really know how to do it, i saw so many tutorials that has the "grid" node, but i don't have it..

civic lantern
#

Along with Modulo node

ornate crypt
#

Okay ty! ๐Ÿ™‚

blissful belfry
#

Im trying to make a texture scroll on a sprite and its almost done just a few errors

#

if anyone can help lmk i can provide my forum post with all details

rare wren
leaden radish
#

if my shader is for mobile it should also work for webgl right?

rare wren
leaden radish
#

hopefully does almost done with the shader

rare wren
rigid halo
#

i am using several Linerenderers to plot out lines on a 2D map and i want to via my HLSL Shader have shine / gradient glow move uniform over them with all like the Gif shows. i am a little unsure of how to go about this. Worldspace position at 0 to start with and then resize the texture i scroll over?

rigid halo
#

figured it out! it was worldspace ๐Ÿ™‚

gritty minnow
#

what text editor/extensions are recommended for editing shaders?

#

i normally use vscode for c#, but none of the shader extensions iโ€™ve found seem to work very well - they donโ€™t add the red squiggly lines and the intellisense seems incomplete

flint yew
#

but yeah, shading languages generally have bad LSP support

low lichen
# flint yew visual studio and Rider have some basic stuff built in

@gritty minnow Rider has really great support for ShaderLab and HLSL. Jump to declaration, auto complete for pragmas, built-in functions, paths to local files in #includes. Even lets you pick which keywords should be considered enabled to show the correct preprocessor directives as active.
https://blog.jetbrains.com/dotnet/2023/07/25/improvements-to-unity-shader-files-in-rider-2023-2/
https://github.com/JetBrains/resharper-unity/wiki/Enabling-shader-keywords

#

I don't know of any IDE or extensions that are as good as Rider's.

flint yew
#

yeah

#

rider is the best by far

#

not free unless youโ€™re a student, though

dusty creek
#

following an old shader graph tutorial, it wants me to hook up emission but I don't have an emission variable in the fragment part. UnityChanThink can an unlit shader not have emission?

civic lantern
dusty creek
#

yea but the tutorial said to use unlit

civic lantern
#

Is the tutorial for URP?

dusty creek
#

HDRP, didn't think it'd be that different though UnityChanOops

#

so no emission for unlit shaders in URP?

regal stag
# dusty creek so no emission for unlit shaders in URP?

Idk about HDRP but in URP "emission" is just a value added ontop of the shaded result. In the case of an unlit shader which doesn't have shading, you likely want to use an Add node to combine the two Vector3s and connect to Base Color

dusty creek
#

ah, I thought emission was like bloom UnityChanThink

warm moss
#

All emission does is add the emission color to the final color, effectively making the color HDR. And the render pipeline's tonemapping + bloom post processing turn that HDR color into a blurry glow in SDR color space that you see on your screen.

dusty creek
#

ooooh, my colors are already set to HDR cuz it usually just looks better, no need for the emission part of the tutorial then

earnest minnow
#

Hi everyone,

I'm trying to create foam effect around the island similar to the one in the first image using shader. The shader will have two textures: the first one is a mask (image 2) to get the outline around the island, and the second texture (image 3) is for creating the foam effect. Does anyone have any ideas on how to solve this problem?

crisp python
#

Hi everyone, i bought URP Material Pack Vol 4 from the asset store and the glass shader which is what im aiming for is pinked out. Is this possibly cause im on the wrong Pipeline?

kind juniper
crisp python
#

ill give it a go

tough bloom
#

Hi, I used a web browser AI program to generate a model. That same model looks much better in the web browser app renderer that created it (left), vs. when imported into unity (right). I'm not sure if it's shaders, lighting, or something else. It just looks less polygonal and more finer reflections on the left. It's using PBR shading in the browser app, and exports the various textures for it. I've imported the same textures into the appropriate channels on the unity standard shader. It just doesn't look the same. Anyone have any ideas?

kind juniper
#

Are you able to rotate the model in the browser app?

tough bloom
#

Yes

kind juniper
kind juniper
#

Can you rotate it such that the lighting is behind, similar to how it is in unity?

tough bloom
#

Ah 10-4. Meshy AI 3d modeling app is the app

#

Yes I should be able to I'll give it a shot

kind juniper
#

Take a screenshot if you're able to do that.

tough bloom
#

See the face and abdomin for the lighting/reflection differences. Back, shoulders, face, and arms for the difference in the appearance of the polygon lines.

kind juniper
# tough bloom

It doesn't look like a correct comparison to me. The first video, there's either no light source at all or several in the scene. And it looks like you're rotating the camera and not the model itself in both videos.

#

Also, the difference in pose might be a factor as well.

tough bloom
#

That is correct, I don't know if you can rotate the model in meshy, and I hardly even know how to work the cam in unity lol. I also recorded on my phone, I can try a screen recording if that might help.

kind juniper
# tough bloom

Try removing the directional light source in unity and bump the ambient light until it looks the same as in the web app and compare again.

#

Btw, you should probably take the model and polish it in blender before actually using it in the project, I don't think ai generated stuff is good for production as is. At least not yet.

tough bloom
#

Ty I agree. This is just an indie amateur project though. Mainly for fun

surreal tiger
#

Is it supposed to be shaded flat?

tough bloom
surreal tiger
#

No, the faces are flat shaded

tacit parcel
tidal wind
#

I'm trying to get my lit shader to work double sided. Do I have to negate the main light direction and attenuation as well?

amber saffron
valid geyser
#

Hello everbody! I have a beginner question about shader graph.
In the Unity HDRP default shader the BaseColor texture input is next to the color overwrite.
Is this something I can do in Shadergraph aswell?
In my shader I have to add the funktions down under it.
Left is Unity's shader and right is my version.

amber saffron
valid geyser
crisp python
#

Hi everyone so i have confirmed my Shader that i got isnt in the compatible pipeline for my project as i am using Built-in pipeline. Could i convert this Shader to be used in Built In? This shader is importante because it has Refraction that i have been looking for for a while

grizzled bolt
crisp python
grizzled bolt
#

As long as the unity version on the BiRP project supports BiRP Shader Graphs

crisp python
grizzled bolt
kind juniper
#

It would help if you take a screenshot of the shader itself instead of a material.

crisp python
#

OK first picture is me opening the Shader in URP and obviosuly it works and the Second pic is the BiRP Graph

grizzled bolt
crisp python
#

I think it's just the BiRP

#

VRC is an old janky game

hearty obsidian
#

Fairly broad question, I am wandering in territory that is unknown to me, apologies.

I have a character, and it has an outline. I render the outline using an inverted hull. I want the outline, exclusively, to be visible when the character is occluded by the environment.

Furthermore, I need this to only happen with specific objects (all objects that should be considered are part of the same layer).

Is there a way I can achieve this?

regal stag
hearty obsidian
# regal stag ZTest Greater and Stencil operations would be what you'd want to look into

Thanks, this is the way I've been headed but I'm struggling to get the results I need.

I have 3 components, each in their own layer

  • character outline
  • character
  • environment

I want the character outline to be rendered normally as you'd expect with default depth testing configurations, but with the exception that it should be rendered above anything in the environment layer, and yet still clipped where the character exists.

In the screenshot I've joined, you can see that it's sort of working but it's not clipping the shape of the character.

My current config has 4 render passes
1 -> Renders environment and sets stencil to 1
2 -> Renders character (not the outline) and sets the stencil to 3
3 -> Renders the outline normally
4 -> Renders the outline again. This time depth test is set to greater (so as far as I understand it, this is true in the case where the outline depth is bigger than the value in the depth buffer), and then has the stencil value of 2 and has a compare function of greater.

My understanding is that because the character wrote 3 in the stencil buffer, then all fragments under the character should have been discarded. I am not certain exactly what I am misunderstanding.

regal stag
hearty obsidian
#

unfortunately I hate the results, but hey, that's life

smoky widget
#

Helllo

#

Im trying to get two shaders to fully color match, however I can't find a way to get the same color on both

#

In this case is the grass and the ground

#

They are pretty close, however not fullly mathcing and Im sure what I can do. They are both based on the lit shader, and the grass has the same normal of the ground

#

my only idea is that it's missing the tangent

#

Here's the ground shader, where only the normal map is sampled

#

And this is the grass, where the base color is also only the normal map and the normal is the ground normal

smoky widget
#

I think it might be related to the render face

#

Im dumb

#

I had the terrain shadow caster disabled

heady moat
#

for compute shaders how can i get a flattened thread group index like SV_GroupID

tidal wind
#

ok, im adding the ambient light to the main light before multiplying it with the base map, however it looks like the ambient light isnt showing...?

tough bloom
#

Is it some form of interpolation?

regal stag
tidal wind
regal stag
#

Try clicking the arrow in the top right of the node, you might have hidden them

tidal wind
#

it still looks the same

regal stag
#

If you're using Built-in target maybe that's why, as it's not supported for that pipeline

bold turtle
#

im looking for a way to lock secondary texture's rotation while maintain the object position,any help?

tidal wind
#

oh damn yeah i see this has been an issue for a lot of people

#

had to convert the bakedgi node to a sub graph, then copy the node from the sub graph and paste it into the original shader graph... weird

hearty obsidian
#

Say I have a cylinder oriented vertically and an angled above-head perspective camera at around 45 degrees. Is there a clever way that I can fake a volumetric effect as if the cylinder was made of dense light that's gradually fading out on the y axis?

#

e.g. the gradient here. I'd like the cylinder to feel like it's "made of" this gradient, sort of like a volumetric effect. Kind of like you'd see if I wrapped it as a texture around the cylinder and looked at it from the front. The issue would however become obvious as the camera would raise in the air and you'd see inside the above of the cylinder

dim yoke
# hearty obsidian e.g. the gradient here. I'd like the cylinder to feel like it's "made of" this g...

2 ways comes to my mind. The easier and cheaper would be to calculate the distance a ray must travel inside the cylinder to hit the backface and use the mid point of that ray for the height gradient multiplier. The other way would be to do raymarching through the cylinder to get density samples inside the cylinder. That would also make it possible to add other effects on top of it like like scattering (similarly how volumetric cloud rendering is usually done)

inner hare
#

I'm not sure why exactly my transparency for my images isn't coming through. Anyone know why? This is a UI image in Screen Space - Overlay. When put into World Space the transparency comes through totally fine. I can provide the full shader file if anyone wants to take a look or find a specific node.

#

I am really, really new to shaders so it's probably something dumb.

#

Oops, I might have needed to turn on alpha clipping. Does that sound correct to anyone here?

regal stag
inner hare
#

Thanks Cyan - is there anything I should be aware of in the case that I don't upgrade? What pitfalls might I see? Right now the shader is a simple vector / UV displacement for breathing physics.

#

It does seem to work properly so far despite not being supported but you've got me interested in upgrading.

regal stag
# inner hare Thanks Cyan - is there anything I should be aware of in the case that I don't up...

iirc Screenspace-Overlay tries to render all shader passes, including the ShadowCaster, DepthOnly, DepthNormalsOnly etc that the other graph types generate.
Alpha clipping might hide that but it's probably still drawing behind so would be unnecessary overdraw. That also wouldn't work with partial transparency.
UI masking (i.e. Mask and Scroll Rects) also won't work as the shader doesn't generate the stencil block

#

You technically can convert the graph to code and edit that to remove the extra passes and add the stencil block yourself, but upgrading might be easier

inner hare
#

That is such good info, thanks a lot. I'm definitely going to check that out. Any version past 2023.2 will do fine?

regal stag
#

Yeah, that's the version that the Canvas Graph was added

inner hare
#

Well I guess it's about time to shop around for a new version then haha :). I'm still on 2022.3.30f1. I see there's no 2023 LTS though. Would you just go to the Unity 6 preview?

regal stag
#

Yeah probably, I've mostly stuck to 2022.3 too. Maybe back-up the project before upgrading just in case

inner hare
#

Awesome. Thanks again!

tacit parcel
# tough bloom Wow this really did the trick! Thank you. Can you kind of explain in layman's ...

I dont know why, but by default fbx seems to export model with all edge marked as sharp (maybe there are some settings that need to be set in the 3d modeller export setting)
by setting the unity import normal to calculate, unity importer will check if the edge normal is under certain angle (which you can set in the same window) the edge will be marked as smooth, other wise it's sharp.
but anyway, this is not about shader anymore but more of #๐Ÿ”€โ”ƒart-asset-workflow things

tough bloom
leaden radish
#

is there a pinned post for all the unity e books?

vague pilot
#

Hey why cant i connect these?

regal stag
vague pilot
#

thanks

light loom
#

Can floats from Materials using custom shaders be accesed through scipts? I have a script that should change the Material value but it doesn't change the value.

regal stag
light loom
light loom
#

Hi, can anyone help me implement a normal map into my shader? I used this node, but as you can see the normal map returns as completely blue aka completely flat. Both the "Normal Map" texture in the shader and the actual normal map are marked as normal maps.

#

Okay, so I somehow can use a "normal" (literally normal, not the normal map) and it will return a normal map value using this node, yet when I use an actual normal map I can't directly plug it into the shader?

grizzled bolt
#

If you already have a normal map, you use it with Sample Texture node

muted pond
#

I am using URP and testing a my multiplayer game via two editors (ParallelSync).
So sometimes my client (only) is throwing this exception:

InvalidOperationException: Trying to use a texture (_SSAO_OcclusionTexture0) that was already released or not yet created. Make sure you declare it for reading in your pass or you don't read it before it's been written to at least once.

I couldn't reproduce it yet - it feels like it happens randomly but it surely has to do something with instantiating a gameobject/meshrenderer I am sure since it's a rendering issue.

Anybody ever saw this error and might have a hint where the source of this is? The game pauses (in editor) and unpausing seems to let the game run without any obvious issues. So I wonder how much of a showstopper this issue is.

solar marsh
grizzled bolt
solar marsh
#

implement a fullscreen effect in an object?

grizzled bolt
solar marsh
#

RecordRenderGraph

grizzled bolt
solar marsh
#

implement fog in the object how?

grizzled bolt
# solar marsh implement fog in the object how?

Objects like mesh renderers have materials which have shaders
In URP you can use the shader graph to make a new shader that samples the skybox and lerps from its base color to that sky color based on view depth or on distance to camera
Though you might need a custom lighting function also if you want to apply that lerp separate from light and reflections

solar marsh
#

A simple fade out in the edges would also work

grizzled bolt
#

Note that Unity 6 doesn't bake scene skybox into the scene reflection probe until lighting is generated

green peak
#

Im generating textures using shadergraph
Im using hex tiles

How do i make each tile look different even though they are thesame material/shader?

Ive tried using a world node tied to a random node, but it doesnt work

strange basalt
#

Object node, get position from it then scale the coordinate to something reasonable and use it to sample some noise or a texture

#

@green peak ^

#

also even your noise example, just drive the world positon into the UV of the noise

#

and scale the coord as needed. difference between it and the object position is do you want to do this per object or per pixel

green peak
#

@strange basalt thank you very much my friend, looks Much better already

green peak
#

object is fine too tho

strange basalt
#

Yeah if per pixel would just drive world position into the UV of your noise

#

You can also sample textures like this too, normally would multiply the coord by a small number first to get it closer to 0 to 1 range

green peak
#

ok

#

let me try that strategy

strange basalt
#

After that it's just deciding how you want to combine it. Like blending it or just multiply or add on top of your existing color

green peak
#

looks promising by that subtle green line still exists, not sure if u see it

#

yea, the smaller the number the better

#

from this point is just a matter of tweaking it to get what I want. Thanks for very much the help Mr @strange basalt

manic locust
#

i have a problem with imported meshes in 2022.3.20.f1, with reflection probes. my fbx mesh simply dont receive any reflections. the 3 meshes in the middle are fbx (table, box, and small sphere) you can see the red reflective shader.
the two spheres on the right are unity spheres. Unity's builtin spheres are receiving reflections, my imported fbx sphere not. material is the same. if i set the material to full metallic, it turns completly black, zero reflections.
this has to be the most basic param im not aware of.

manic locust
#

when i import into unity6 hdrp, everything is fine

#

i thought the mesh would be the problem with urp, maybe wrong import settings normal/tangent calculations. but imported as is in hdrp and it is simply perfect.

light loom
#

Hi, I just came up with a nice shader for my game. In Scene View, the shader looks fine, but when Playtesting, the scale of the object is messed up. I used this node setup (Image 1) to achieve a tiled look. The second image (Scene View) is a material I created using this shader. I tweaked a few settings (so that the Voronoi texture is stretched into these lines) and am happy with how the material looks. However, when entering play mode (3rd image), the stripes suddenly are huge.

grizzled bolt
light loom
dense dawn
#

Is there a good alternative to scene depth when using the built-in render pipeline?

grizzled bolt
dense dawn
regal stag
whole salmon
#

I have a relatively simple SG "outline" that I'm using to highlight a mesh (including when it's behind other meshes since the unit can be obscured by terrain). I'd like it to be a little less "show through" on the mesh itself. Any tips?

#

(like the outline isn't really an outline - since you can see it "through" the unit - like around it's neck, chest geometry)

#

here's my SG

exotic garnet
#

Respected,
this will call on the particle collision....

if (_hit.collider.gameObject.name == gameObject.name)
{
UIController.instance.UpdateCurrentInteractingObject(objectName);
Debug.Log("why2: " + hit.textureCoord + "..." + hit.collider.gameObject);
// If the ray hits the object, returns the texture coordinates of the hit point.

return _hit.textureCoord;

}

this code works fine in the editor.
but when I export the android build..
it returns the default unity cube texture point correctly on collision... but on other meshes it print the name correctly and always return the (0,0) texture hit points on each part collision of the body.
I have applied my shader, but I think it's not relevant to the shader.
I don't know, I didn't get anything relevant to this..
And i am trying to get the solution from past two days.
Kindly guide.
Thanks

grizzled bolt
acoustic beacon
#

how do I get rid of light reflections on material through shader graph ? (Built-in Pipeline)
I deleting the metallic node I read from a discussions.unity thread, but issue is still there.

grizzled bolt
#

You can add them back by right clicking the space above or below your remaining fragment block nodes

acoustic beacon
grizzled bolt
desert herald
#

Just to ensure, while targeting GLES3.1 I am capped at max [numthreads(32,32,1)] for a compute shader, right?

#

Or even less... Based on this table

#

It gives 32,24,1 cap, but those numbers "should be powers of 2" according to the internet, so it gives max of 32,16,1 ?

frigid jay
warm moss
#

But that might require handwritten shaders.

desert herald
#

It's tricky in urp though

#

I've ended up not using stencil at all, just two passes and conditional float variable

solar current
#

I feel like I'm going crazy

#

Does anyone know where I can look at the Terrain system's WindZone calculations? I am using the WindZone component with my fog shader but as of right now the 'Turbulence', 'Pulse Magnitude', and 'Pulse Frequency' variables are ignored

#

It does not have to be the Terrain's calculations, I don't actually use Unity's built in Terrain system but as far as I can tell the WindZone component is not used anywhere else. The Unity C# Reference Github page is also lacking in any actual Terrain scripts besides the ones for the Terrain Editor

warm moss
low lichen
desert herald
# warm moss What's tricky about adding a Stencil block to a shader? ๐Ÿค”

tried to write a simple shader to be able to toggle highlight on/off, then encountered 2 problems, first about actually using second pass, because it just didn't run with or without stencil block. work around by setting 1st pass to "LightMode" = "SRPDefaultUnlit" and the second to "LightMode" = "UniversalForward"
but even then i couldn't get access to SV_StencilRef, so i simply made a float _Highlight property and in 1st pass something like this

            v2f vert (appdata v)
            {
                v2f o = (v2f)0;

                UNITY_SETUP_INSTANCE_ID(v);

                if(_Highlight == 0.0)
                {
                    return o;
                }

I admit - my skills with writing shaders are still quite poor, don't know if this is a valid approach, but at least it works

low lichen
desert herald
#

so in this case using separate light modes for such effects is acceptable?

#

or maybe i should ask - what would be a proper method for doing this?

low lichen
desert herald
#

omg i was so blind xD just looked up "Renderer Feature" in docs. that clarifies things a lot, thanks

warm moss
#

Hm, looks like Render Objects allows overriding the stencil metadata, that sounds like the most painless way with no scripting required.

low lichen
#

But sure, if you aren't actively working on the game after release, there may not be good reason to. That's just become increasingly less common with the rising popularity of live service games.

warm moss
#

I'm working on a live service game. But we upgraded to a newer version of HDRP only after a couple years, I doubt anyone's upgrading to every yearly release to get some fancy new feature that's better implemented in a third party asset anyway. But I do have a very jaded view on relying on new features that Unity adds ๐Ÿ˜†

acoustic beacon
supple kayak
#

Hi! How would I go about setting vertices on a standard surface shader that I get from a float3 structured buffer?
All of the research that I had done doesnt contain anything about using the vert with a structuredBuffer.
I also have the #pragma vertex vert
On the second image you can see how I set the structured buffer from C#
Any help is greatly appreciated!

regal stag
#

For accessing the buffer I imagine you might need SV_VertexID which you should be able to provide using a custom struct instead of appdata_full

supple kayak
#

ah I see, sorry for bothering but how would such struct look like? I am still very new with CGPROGRAM ๐Ÿ˜…

regal stag
#

That's the same as appdata_full but with added vertexID input

supple kayak
#

Ah I see, however for some reason I have this error on my shader
Unexpected identifier "StructuredBuffer". Expected one of: typedef const void inline uniform nointerpolation extern shared static volatile row_major column_major struct or a user-defined type
I even tried setting color of all vertices just as a test and it doesnt seem to work, I also replaced #pragma so now it looks like this

I do know that my compute shader is working correctly because I currently have the vector3[] public that I retrieve from the buffer and I can see on the inspector that the Y values seem correct

regal stag
supple kayak
#

well I tried setting the structuredBuffer inside of #ifdef but then my vert function cant find the "vertexPosition" variable
"undeclared identifier 'vertexPositions'"

I also set the target to 5.0

regal stag
supple kayak
#

but even if I put the function and struct inside of the #ifdef, do I also have to add the #pragma part aswell? Because it cant find the vert function now
"Surface shader vertex function 'vert' not found"

regal stag
supple kayak
#

Ah that might be smart! I'll try it once I log back on my computer, thank you for your help! I'll make sure to tag you if something goes sideways haha

quaint grotto
#

so this is rather amusing given the context but how do I fix it ? the preview limit is set to default 128 why do i need to change it =/

low lichen
#

128 seems pretty low for a default, lit shaders often have thousands if not tens of thousands of variants. But I don't know how this preview limit is counting them.

quaint grotto
#

im using urp if that matters? but if 128 is low why do i get this error

#

oh how many is it likely making?

#

what would be a good number

regal cove
#

I am trying to make a pixleated look for my game using a render texture, but any movement is like drawing on the camera and it stays, making a smer effect

kind juniper
minor prism
#

Is it possible to write a shader that draws a 3d grid(x,y,z axis) in world position? I also need the grid color to be different around a sphere radius

amber saffron
minor prism
amber saffron
visual blaze
#

how can i create or find cross hatching shader that only applys cross hatching to shadows and rest everything is the same not toon

uncut gyro
#

Hey, I have a pretty simple shader -> https://pastebin.com/fGbK58nv

public void GenerateBlendTexture()
{
    _blendTexture = new Texture2D(Width, Height);
    _blendTexture.filterMode = FilterMode.Point;
    UpdateBlendTexture();
    Sprite sprite = Sprite.Create(_blendTexture, new Rect(0, 0, Width, Height), new Vector2(0.5f, 0.5f), 1);

    _blendSpriteRend.sprite = sprite;

    _blendSpriteRend.material = _blendMaterial;
    _blendMaterial.SetTexture("_MainTex", _blendTexture);
}

private void UpdateBlendTexture()
{
    for (int x = 0; x < Width; x++)
    {
        for (int y = 0; y < Height; y++)
        {
            Color color = _generator.GetTileColor(x,y);
            _blendTexture.SetPixel(x, y, color);
        }
    }

    _blendTexture.Apply();
}

I'm using it like this and texture looks correct but the generated material is just transparent

regal stag
silk sky
#

Is it possible to make a seamless shader like this via shadergraph?

uncut gyro
regal stag
#

Can also find the Sprite-Lit-Default or Sprite-Unlit-Default shaders under the Packages/Universal RP/Shaders/2D which might help as a template

uncut gyro
#

alright, let me check that

#

okay simply removing

            Name "Forward"
            Tags {"LightMode" = "UniversalForward"}

seems to fix the issue

#

thanks

silk sky
slender wren
#

Does anyone know how to preserve/build Hidden shaders when building? I know you can manually add it on Edit -> Project Settings -> Graphics, but I am making a package and I would rather have them included when they are being used (which they are) but when building they are not present

slender wren
#

Nevermind, I figured it out thanks to Cyan

#

in one of his previous comments on it

fair plume
#

Hey! Im working on loot indicators for my fps game, basicly every lootable objects has some kind of UI (quad with a texture for now)
Im wondering is it possible to place this quad inside the item mesh and make it see through without playing around with layers?

#

I only want the quad to ignore the render order for that specific mesh that it is related to

supple yacht
#

why does it cull the white part of the texture instead of the transparent part?

steel notch
#

So let's say I have a character model, and I want one part of it to be sort of wispy. Like it's supposed to look like plasma or some ghost-like element. How would I best set that up?

#

Would I have some type of secondary texture on the model that defines these wispy regions?

#

And a shader that uses that uses the value from the texture to apply vertex distortion?

tacit parcel
tacit parcel
steel notch
#

So I have these trail renderers. They do not appear very smooth at low frame rates.

#

The trails are being moved along a spline. I'm assuming this jaggedness happens because at higher framerates, the large delta time is making the the object jump farther distances.

#

How can I make it so, regardless of framerate, the paths look relatively smooth?

#

I'm assuming trail renderers are more for unscripted movement.

#

Should I be using a line renderer?

tacit parcel
#

yeah, I'd vote using line renderer instead, you'll have more control, although that comes with a price of doing all the trailing manually

steel notch
neon mason
#

I made a fullscreen shader, which creates this shockwave effect, added the material to the custom pass volume, but in the scene window you can see UV. How to fix it? I tried to use Scene Color, but the result is all white. HDRP

fair plume
amber saffron
red wedge
#

Hello!

I have the following script:

void CreateRenderPass()
{
    if (BlitColorMaterial == null)
    {
        Debug.Log("Material is null. The pass won't be created and injected.");
        return;
    }

    // Creates the render pass and specifies it to be injected at AfterRenderingSkybox event.
    m_ColorBlitPass = new BlitPass(BlitColorMaterial, RenderPassEvent.AfterRendering, _RenderTexture);
}

The problem Iโ€™m encountering is that in VR, my UI doesn't appear. Iโ€™ve had this issue before because I didnโ€™t select the correct RenderPassEvent. I fixed it by using RenderPassEvent.AfterRenderingPostProcessing, and it worked fine in the editor.

However, in the Android build for VR, it doesn't. I changed it to RenderPassEvent.AfterRendering, but the UI still doesn't appear.

Does anyone have any ideas on how to resolve this?

onyx cargo
#

Iโ€™m using the built-in render pipeline and pp stack v2, is there any way to make effects like ssao and ssr to work on transparent materials? I understand itโ€™s bc they donโ€™t write depth, but there has to be a way around it. I find it hard to believe that you just canโ€™t have things like ssao work on transparent decals

onyx cargo
#

i know this isn't just me bc i see it in some really popular 3rd party assets, like atmospheric house from finward studios:

#

this is just... how it has to be? that looks awful

lean skiff
#

Hello, I'm looking to unwrap a mesh and show the predisplaced vertex position (local bounds) but the Position node value gets changed if I unwrap using this shader graph:

#

any idea how to get access to unmodified Object Position? I've banged my head about this for hours now with no avail

regal stag
lean skiff
lean skiff
#

I'm sorry if this seems really basic, but for me it's not, I come from Unreal Engine, where pre-skinned local position is a thing

regal stag
#

Probably not helpful, but I know it's a lot easier in URP as its SSAO isn't a post-process but generates a texture (using depth/normal prepasses) that is then sampled in scene shaders.
And the decals feature has a DBuffer mode which similarly puts decals into a texture, then sampled by opaques so automatically applies SSAO.

onyx cargo
#

not even dbuffer mode

#

oh! nvm i was using the wrong shader ๐Ÿคฆโ€โ™‚๏ธ

hexed sorrel
#

Hey all! I'm currently trying to make a simple 2d "wave" shader for my in-game water, however I am seeming to have a difficult time figuring out how to accomplish a "wave" effect, I keep getting different variations of the liquid's entire UV being moved when it realistically should just be the top area, my current solution is a little bit funny looking and would love any advice anyone would have! I assume I need to mask out part of the UV to just the "top" half but again am not really sure of a good way to do that in shadergraph, ideally it would be based on a float that could be adjusted.

hexed sorrel
amber saffron
hexed sorrel
#

Oh, I see!

amber saffron
#

However, if like I suspect you are using sprites, deforming vertices doesn't have enough precision, what you likely want to do is to distord the UVs before sampling the texture.
If you want a sine wave along the X axis, use UV.x * Time as input of sine, add this to the UV.y (only Y) value to have vertical distortion, and use it as UV input in a sample texture node.

hexed sorrel
hexed sorrel
hexed sorrel
#

Hey also, just wondering if anyone knows how I can get access to the "Texel Size" node, I can find the documentation for it but can't seem to in the shader graph? Is it possibly only for a particular shader type?

hexed sorrel
#

I see! Thank you.

rigid halo
#

Out of curiosity does anyone know if it is possible to manipulate vector art ui via shaders? I mean like vertex manipulation on meshes kind of animation via shaders?

Do i need to figure out something custom for this or is it just not worth the hassle and i should just animate by other means?

kind juniper
sonic umbra
#

In ShaderLab, is there an integer range property type?

#

Like Range() but for ints instead of floats

tacit parcel
sonic umbra
#

I see, thanks!

#

Is the object to world matrix indexed column-wise or row-wise? I'm wondering if instead of multiplying it by (0,0,0,1) I can just do matrix[3]

amber saffron
south acorn
#

I'm trying to sample noise from the world space position to create seamless water displacements. This seems to somewhat work in the sense that the noise moves around like a world space shader would but all the planes never align and it doesn't seem to 100% accurately get the noise in world space

#

If I add the offset given from simple noise onto the vertex position and move the plane it also doesn't accurately follow the center of the plane and seems to go further than it should

regal stag
south acorn
#

Ohhhhh that makes more sense thank you lol

#

Yess that worked perfectly

atomic wharf
#

Hi peps, i'm looking for a way to convert world position to clip position? UnityChanThink

regal stag
atomic wharf
#

Thanks.

uncut gyro
#

Hey, I have a small issue. I want to apply a texture on the tilemap (black one) so I made this shader. But it fills the whole tile instead of following the shape. How can I fix it?

steel notch
#

How do you go about hiding internal front faces in a transparent mesh?

#

Fresnel effect, transparent.

#

Write to depth buffer first?

low lichen
low lichen
steel notch
# low lichen Yes

I would basically be drawing the mesh twice no? Like it would be pretty expensive.

low lichen
steel notch
low lichen
#

And it needs to render before the fresnel material.

coral hinge
#

Hey so I was watching some rec room videos, and I was wondering if there's a way I can achieve this type of lights in unity

#

I know that the game is made in unity but nobody else has been able to figure out how to gets lights like this and I'm trying to see if someone can help me achieve this

#

Also something that I find cool is how they fade out

solid dirge
#

Hi, not sure if this is the right subforum but anyway... this happened after I merged two projects. Is it possible to solve without making new materials? The color is still there, it seems. But I can not make it red again.

solid dirge
neon mason
solid dirge
#

I select the material and choose Reimport and nothing happens. No dialogue etc ... how does unity know where to reimport from?

neon mason
#

are you sure there 2 projects have the same render pipeline?

cloud orchid
#

Is there any documentation on how to create HLSL shaders that work in the full screen render feature?

I'm trying to create a blur shader and im having no luck with the shadergraph approach

solid dirge
neon mason
solid dirge
#

No they didnt. The lower one is the project ("None..") that is imported to the top one ("Unversal..."). The imported project is the one that has the materials and objects. The first one is for a VR setup.
How can I fix this?

neon mason
#

change the material shader to URP/Lit

solid dirge
#

turns white. If I do the import all over, could I do something to make it work from the start?

#

unless there is an easier fix

neon mason
solid dirge
#

didnt work in current project. Should I do this beforehand?

neon mason
solid dirge
#

I tried, makes it white

solid dirge
kindred crystal
#

standard render pipeline. trying to create a dynamic normals texture using a shader that current outputs a dynamic color texture.

is there any way to set up multiple render targets that can be targeted in the built-in forward opaque pass? perhaps using command buffers? i have the command buffer set up and verified it's working, and have tried to set the render target before forward opaque, but the dropdown for multiple render targets is disabled in the frame debugger.

edit: i figured it out, can't use command buffers to mrt for the entire camera. gotta be use cam.SetTargetBuffers(...)

this thread helped me understand.

warm moss
coral hinge
cyan laurel
#

Is there a way to create bloom for specific objects without HDR and multiple cameras? I have a circle countdown effect that needs to have a bloom effect on user's profile picture. Since it is a "Filled" image (it changes depending on the remaining duration), i cannot put a static glow image. I also cannot use different cameras because the UI layout is really complex. I did achieve it with HDR but i've read that HDR can hurt the performance (i'm really not sure about this, i can use it if it does not make a large difference), and the game is going to be played on low-end mobile devices too.

warm moss
fresh vigil
#

Does ztest in shadergraph work? seeing "always" as normal (LEqual) :/

shell wadi
oak aspen
#

Any idea why this thing is stretching the texture at the top and on the face it's not showing the tiles "vertically"? I basically want the same size squares for the whole object. I tied triplanar too but that is producing some ugly artefacts (like extra gridlines in the middle of another grid etc). Any ideas how i can fix this?

grizzled bolt
oak aspen
#

so planar mapping... I'm assuming that's not a node huh

grizzled bolt
#

Which you're more or less doing here, I mean

oak aspen
#

oh hmm... ok i put the position into a swizzle and the mask... well i'm trying the different permutations... so far they still stretch at the top

grizzled bolt
oak aspen
#

oh! i thought that was the solution i should be looking for...sorry misunderstood you there

#

so what do i need to do to fix this?

grizzled bolt
#

Creating a grid from 3D position directly would give you the most accurate grid, though since the rounded arch doesn't really conform to any grid it might look weird but I'd still try it
Another option is to UV unwrap the mesh precisely for a grid texture, so you can prioritize making it look good rather than "exact"

#

Position can be turned into a grid quite easily by repeating it with fraction or modulo, and then using Step or Smoothstep on it

oak aspen
#

not gonna lie, 1) i'm crap at unwrapping models and 2) i have a lot of different meshes of sizes etc (which is why i was looking at the shader option)

oak aspen
grizzled bolt
oak aspen
#

hmmm this is basically creating the grid and putting it on top of the texture. I think i understand what you mean... generating the grid procedurally

oak aspen
#

yeah i don't know what I'm doing tbh... i just tried triplanar again (even though for some reason a few tutorials warn against using them a lot because of performance)....If i can fix those weird looking faint lines in the middle, I'd settle for that

karmic hatch
#

(which should create a 3D grid eather than mapping 2D grids)

#

Though ig if you need to use a texture it won't work

oak aspen
#

yeah i still need textures ๐Ÿ˜ฆ

karmic hatch
#

Can you not just UV map your tunnel?

oak aspen
#

i've tried in blender but 1) i realised i'm crap at uv unwrapping and 2) i have a ton of different shapes and sizes (it's basically a modular set for a level creator for my game)

#

so if i can avoid spending a month unwrapping these things by doing a shader, that would be optimal haha

#

or at least that's what I thought

karmic hatch
oak aspen
#

yeah the blend float... that's the best I could get it... still looks a bit off but I might have no other option. Are triplanars that heavy? I've been reading not to use them a lot due to performance

tacit parcel
oak aspen
grizzled bolt
#

The rounded arch won't be on a grid though no matter how perfect the grid itself is, as I mentioned

oak aspen
#

This is the result of the triplanar with blend set at 200 (not sure why i needed such a high number but at least those weird middle lines disappeared)

#

doesn't look too bad if I can have hundreds of these meshes (basically to make a level) and triplanar doesn't cause issues with performance

grizzled bolt
#

That's functionally the same result you'd get with a procedural grid

oak aspen
#

hmmm... well if i can still use a base texture and a normal (and have advantages to using triplanar), I'd be interested to explore it

atomic wharf
#

Wondering how can i get displacement from one float4. Normally, i'd subtract a vector to the relative position but i'm wondering if it's different with float4.

shell wadi
# cyan laurel here

Could definitely achieve that with a shader yep. I would make the shader render the circle w/maths, then inside the shader do the circle trimming and bloom.

cyan laurel
coral haven
#

Hey,I've been trying to make a cartoony-like outline shader for my game and instead of getting the edges to have a smooth black outline,they just pop off the object (no matter what width I set for the outline) and it becomes a black texture.
Can anyone help me?
Here's the script for the shader: (URP-Shader btw)
https://hastebin.com/share/afisabusoh.cpp

hardy agate
#

I have a problem with my shader. Iยดm working with Shader Graph, use Position node (absolute world) for my decal as to have nice seamless tiling whenever two pieces meet. But I found a problem when rotating the decal itself, for some strange reason the normal or the lighting seems off, as if the normal is transitioning to the inverse and back.

If anyone have any idea, I would really appreciate it.

regal stag
regal stag
# coral haven Hey,I've been trying to make a cartoony-like outline shader for my game and inst...

URP does not allow multiple UniversalForward passes in a shader. You can do one without a lightmode tag but it'll break SRP batching compatibility. It's better to apply the outline as a second shader/material or use RenderObjects feature.

As this technique pushes vertices out using normals, faces will also become unconnected if the model is flat shaded. You'd usually only use it with smooth shaded models.

coral haven
#

or I could try the feature u told me about first,I dont really wanna stay and convert everything for a outline

hardy agate
magic dove
#

What is the equivalent of URP Sample Buffer in unity 2020, it does not exist in the version i use

regal stag
magic dove
coral haven
#

notlikethis I've made a URP Outliner with a shader graph,I can see it while in the editor but when I go on play mode I cant see it no more,I think I should do something with the camera's settings but I don't know what.Can someone help me? blushie

novel depot
#

-Closed- I managed to make it work by multiplying the step with the logo sprite and then applying the result

lofty stone
#

Hello Everyone!
I'm having a little problem while following a tutorial.

I'm following a GabrielAguiar Tut, and i have that problem making the shader, but i'm starting to learn about shaders and VFX

#

Someone know how to fix that?

oak aspen
#

Hi. I'm trying to put a "decal" on a wall and be able to control the sizing and positioning of it... that all works but I'm getting that stretching that you see on the x and y (if i scale the texture down)... I tried removing it with smoothstep and this somewhat works but most of the detail gets lost. Any other way I can remove those? (I know there are other ways to do a decal but I'm trying to avoid that route if i can)

regal stag
#

Oh also should use the clamp wrap mode on texture itself rather than clamping the UVs (otherwise with bilinear filtering the bottom pixels still interpolate against the top, hence why its darker there)

oak aspen
#

oh damn ok so setting the wrap mode to clamp got rid of the Y stretching at the bottom (for some reason)

#

so I basically need to make a mask from the alpha of the texture if i'm understanding right?

#

oh wow ok that worked! ๐Ÿ˜„ thank you so much

regal stag
#

If it's just on an input/output to that function you could move it into the graph itself using the Colorspace Conversion node

regal stag
regal stag
magic dove
coral haven
regal stag
#

Might be static batching. I'd probably suggest looking into other outline techniques though as this'll only really work with simple shapes like cube/sphere

coral haven
#

oh alright

#

thanks

lofty stone
#

Btw i'm using Unity 6

cloud fog
#

Hi, when using the Camera node to figure out the distance from the camera's position, it's using origin position (0,0,0) rather than the camera's current position in the scene. Any idea how to fix?

hushed silo
#

Hi so I'm trying to make this custom hlsl function node work in shader graph, and I can't seem to get an output out of it

#

whatever I do it won't create an output node for it, error message included in the screenshot (no 3 parameter matching function at the moment. Is anyone able to give me a pointer? I've tried including an out float in the hlsl function definition also

regal stag
lofty stone
#

And that's the config of the Node... I don't know why i'm getting this error

hushed silo
regal stag
hushed silo
#

oh god damn it

#

hahaha thanks so much

#

I've been going through loads of different iterations of possibilities

#

and probably got it right a few times already and didn't know I'd collapsed the output

regal stag
regal stag
lofty stone
cloud fog
foggy chasm
#

in editor outline shader working good but in build it looking like this ( using URP with Forward+ render)
I tried to change render queue too but it didnt fixed

smoky widget
#

Hello

#

So I'm using Shader Graph and GPU instancing by using the Graphics.RenderMeshIndirect(). Everything works fine in the editor window and play mode, however, when I create a build, I don't have any shadows on scene

#

I have no clue what I could be missing, and Im not even sure where to start looking at this, any idea on what could be a good starting point to find the issue? The directional light looks fine (no weird rotations or parameters)

smoky widget
#

Found the issue

#

It was because I had changed the instance key from multi-comple to shader feature

#

reverting it fixes the problem

hushed silo
#

so, I am making some animated noise to distort a world space shader effect, however with my config of nodes and stuff, instead of the noise middle staying the same, as the noise multiplier increases the noise drifts off in XZ... I assume because of the noise adding onto the world position. But i've tried a couple of things like subtracting 0.5*noisemultiplier and stuff and it hasn't worked. Any fresh eyes see where I'm wrong?

lilac mist
#

I'm working on a sprite shader based on sprite default lit, but my outlines end up different from the base material, and I'm not sure why. What exactly decides the edge of the sprite as shown here?

#

The left is just, sampling the texture and directly outputting it as color and alpha. Shouldn't that produce the same outline as the sprite default lit?

regal stag
lilac mist
#

Hm. Will it affect anything visibly, or is it just a quirk?

regal stag
#

Shouldn't affect anything visually beyond the outline (and maybe what parts you can click to select the object in editor)

lilac mist
#

Alright, thanks

#

Also, when using normal maps in the shader graph, the results are visually different from what I expect

#

depending on the "type" I use I get different results

#

however neither is what I expect

#

What is the correct way to sample normal maps in 2022? I don't recall it being like this in 2021

regal stag
regal stag
lilac mist
#

I see, so this too is just a visual quirk in the previews and such

lilac mist
#

Wait, there might be something else here.

#

These two point to the same texture. In that case, whichever one I sample shouldn't matter, right?

#

But it does, it only creates a functioning normal map if I go through the _NormalMap

#

Is the _NormalMap treated in any special way prior to being loaded into the graph?

#

I really don't see a tangible difference between these two...

royal bloom
#

how can i make a shader to fade out my arms like this?

regal stag
# lilac mist Is the _NormalMap treated in any special way prior to being loaded into the grap...

There are some special references which are swapped out automatically when assigning the Sprite, _MainTex is the main sprite texture for example. I think any other maps depends on how what "secondary textures" are assigned to the sprite
https://docs.unity3d.com/Manual/SpriteEditor-SecondaryTextures.html

Any other texture references would be assigned on the Material itself - and if you created the material before changing the Default field it will still use the old value, the Default is only used for newly created materials (and the automatic material asset under the graph)

lilac mist
#

Ah, so my default texture doesn't work because I added it after I made the material

regal stag
#

Yea, but you can still manually assign it

regal stag
lilac mist
#

Right so default textures aren't used in the case that no texture is assigned. They are just used when creating a new material to fill the slots

regal stag
# royal bloom

Then you could create a gradient texture and use that to control the alpha in a transparent shader

royal bloom
#

how do i do that

#

the gradient texture

royal bloom
#

to control how high up the arm the fade starts and ends

regal stag
#

Personally I'd apply vertex colours to the mesh, it would be easier. The idea is to paint one side of the arm black and the other white (with appropriate greyscale values for vertices inbetween).
In the shader you can remap that into a 0-1 range using start/end floats (in Shader Graph would be Vertex Color node then Remap or Inverse Lerp. Use that result to control the Alpha)

lean skiff
#

Hello, why does the "Object" node in shader graph return 0 for the bounds size, min and max?

#

I've tried this with a primitive sphere, and when I debug, it's always 0 (black for all of the inputs, except Position and Scale)

regal stag
lean skiff
lean skiff
#

a better question would be (since I'm new to Unity altogether) should I use URP instead of built-in renderer?

regal stag
regal stag
lean skiff
hushed silo
bright heath
#

How possible would it be to apply different level of a pixelation shader to different object? Iโ€™m working on a 3d fighting game and want to change pixelation of individual object dependent upon health

hushed silo
#

something like that can work depending how you're doing it

bright heath
#

Alrighty so, I'm on Unity 2021.3.43f1 and for some reason I cannot create a shader graph

#

I'm sorry if I've missed something obvious, I'm just getting into unity as it's a requirement at my college and I only really have experience with Godot lol

royal bloom
#

im trying to find a video on how to apply the vertex colors to mesh

regal stag
bright heath
#

ooo alr

#

Like the "new" input system then

royal bloom
#

im not sure how to do that

strange basalt
royal bloom
#

how to apply the vertex colours to the mesh

#

and the rest

strange basalt
#

trying this in the 3d package or in unity?

royal bloom
#

wdym

strange basalt
#

is this a mesh you are making in something like blender you want to apply vertex color to

#

or something where it has to be done inside of unity?

royal bloom
#

yeah

#

in blender

#

i made a uv map

#

for the arms

strange basalt
royal bloom
strange basalt
#

select vertex paint mode up here

royal bloom
#

im just trying to do what the guy said

#

alright

strange basalt
#

then you can just select the color you want and paint the verts that color

royal bloom
#

i aint got that

strange basalt
#

select the mesh not the rig

royal bloom
#

alright got it

#

he said to make it going from black to white

strange basalt
#

yeah you can just paint the verts what ever color you want see here i got my top verts white, bottom ones black

#

whats your shader in shader graph or hlsl

royal bloom
royal bloom
royal bloom
#

its not just a long cube

#

isnt there a way to do this without this whole vertex painting?

#

just with a shader in unity

#

since i got the uv map

#

i have no idea what this is

#

or what im doing

strange basalt
#

would google like vertex painting and blender or something then

#

did a test with multiple edge loops lioke yours as well

royal bloom
#

show me how its cut

strange basalt
royal bloom
#

so im here

strange basalt
#

i just painted the very left black, the next loop slightly brighter, the next loop a lot brighter then the right side made it white

royal bloom
#

what do i press not

strange basalt
#

set color black paint the verts you want to be black black

royal bloom
#

how do i paint them?

#

click?

strange basalt
#

yeah can click and hold, jsut make sure its from a angle where the vert is visible

royal bloom
#

got that

royal bloom
#

it looks weird

#

its not consistant

strange basalt
#

yeah you can just figure out the ideal color to set each loop to

#

like did my with loops and just figure out the inbetween values eye balling it

#

could also math out the values if you want

#

since you know the value got from (0,0,0) on the left to (1,1,1) on the right

#

and you know total length of the object and where each loop is relative to that length

royal bloom
#

then how would i even go about making the shader

strange basalt
#

well can access this data in the Vertex Color Node in shader graph

#

can just use the values from vertex color to adjust your alpha in the shader

grizzled bolt
#

Could make a thread

strange basalt
#

@royal bloom should follow a few simple tutorials on shader graph first

civic lantern
#

Are you using Builtin, URP or HDRP? And is it a shader graph?

civic badger
#

so i believe builtin?

lean skiff
#

Is there a (free) way to debug vector values in shader graph? like draw the coords values in the preview window?
Edit: nvm I have found an hlsl code snippet in github that debugs floats

warm moss
lean skiff
#

I'm new to Unity, does Renderdoc do this?

warm moss
#

Renderdoc lets you step through the shader code line by line and inspect how a screen pixel you picked was rendered.

hollow swift
#

How do I tell a shader graph how to behave when handling sliced sprites? I want to create a 9-sliced shader that should tile the middle piece (used in a line renderer). Basically I want to emulate how the SpriteRenderer interprets sprites when set to "tile".

frosty fulcrum
#

Im trying to rotate a vertex based on its new offset position and a given origin. The aim is for the vertex (imagine a plank) to always touch both points. I have calculated to correct angles, but im struggling to use two RotateAroundAxis in a row. There is probably an issue with pivots? Is there a better way ?

regal stag
amber saffron
amber saffron
frosty fulcrum
regal stag
hollow swift
hollow swift
# frosty fulcrum

Thanks, that's very cool. It does do an awful lot of tiling along V in my case though, which is not what I want. Not sure if I did something wrong.

#

Looks like way less nodes than my solution though ๐Ÿ˜ตโ€๐Ÿ’ซ

amber saffron
#

If it works, don't fix it :p

hollow swift
#

Well it doesn't, that's why I'm asking here ๐Ÿ˜„

#

Because in my case the middle section repeats the whole texture, not just the middle part. So the edges are repeating in the middle too.

amber saffron
hollow swift
#

I'm not very good with shaders so I don't know what you want me to do. :/

amber saffron
hollow swift
#

Thank you very much, I will check it later. ๐Ÿ™‚

#

And hopefully learn a thing or two ๐Ÿ™‚

amber saffron
frosty fulcrum
royal bloom
#

@civic lantern

#

i made the shader graph

#

how would i even start

#

i made a lit one

civic lantern
#

Look at tutorials and/or existing shaders

#

You also need to enable transparency on it, probably somewhere in the Graph Settings

#

Then you should be able to create a Vertex Color node and plug it into the Alpha in your Fragment output

civic lantern
#

Yes

royal bloom
#

i painted the vertexes in blender

#

now i need to make a shader graph to convert the colors from 1-0

#

1 being black and 0 being white

#

and then have a start and end float

#

which will determine when the fade of the mesh will start

#

trying to achieve this

grizzled bolt
royal bloom
#

could u explain it more

#

im really new to shaders

#

i just need two values which i can modify

#

the start end end of the fade

grizzled bolt
# royal bloom could u explain it more

If your mesh is UV unwrapped to use textures, you only need to make a material asset that uses the urp Lit shader, set it to transparent and assign a base texture that has your fade in its alpha channel

royal bloom
#

for my arms

#

oh yeah its unwrapped

#

if thats what you meant

royal bloom
#

i made a material

#

of the skin color

#

is that fine?

#

i set it to transparent

#

but what do you mean by the base texture

royal bloom
#

i need to adjust how much it fades

#

with two floats

#

like i said

grizzled bolt
royal bloom
#

can i do that during runtime?

#

im constantly going to be changing it

#

how much the arms fade

#

where the fade starts

grizzled bolt
#

Not any more than with vertex colors
If you do need to remap the fade in some way then you will need a custom shader

royal bloom
#

yeah

#

as in like the code one?

#

or a shader graph

grizzled bolt
#

It seems you need a bit more understanding of what materials and shaders are and how they're made before you can practically implement our advice
And for you to describe in precise terms what you want

royal bloom
#

i just need to be able to achieve this

#

also be able to control where the arm starts fading away

#

and where it finishes fading

royal bloom
#

this is what someone wrote above

quartz sail
#

hi for some reason my base map isnt lining up to my model, ive never had this issue before and i was wondering if anyone new what ws wrong. i UV unwrapped it in blender and brought it out and plugged it into the base map

strange basalt
# royal bloom

that might also be possible via Scene Depth as well. do you want the arms to always just fade away near the ends, or is it just about things being close to the camera fading out

royal bloom
#

my camera clipping is set to the lowest value

royal bloom
#

so i can set it when i want the arms to fade

tacit parcel
#

you need to compare the clipspace z to a value

o.color.a = smoothstep(0, _whereYouWantFadeToStart, o.vertex.z);
south acorn
#

I'm looking into foam and I'm having an issue regarding depth. Here's my node setup
I'm assuming the issue is that obviously the closer I get to the foam the less depth the scene is going to have and the further I go away from the water the more depth it has so the less foam there is. The issue I'm having with this is foam only shows up at a certain depth (and is cut off further away). I was thinking of increasing the depth and trying to limit the reach foam had but I don't know how to go about limiting the reach

#

DepthFade sub graph

#

Generally speaking my DepthFade node doesn't really seem to stay consistent and it's annoying. Maybe the DepthFade node itself is the issue

#

Nevermind for some reason getting rid of the camera far plane multiplication and plugging the scene depth in just worked

smoky widget
#

Does anyone know if there's any difference on the results between Vector3.Cross and cross of shaders?

#

Or between Vector3.Dot and dot of shaders

#

I wrote some simple code that worked in the CPU and for some reason on the GPU it's not working

strange basalt
#

its the same operation

#

would look into other differences since a dot or cross given the same inputs will have the same output does not matter if CPU and Vector3 type or in shader

dim yoke
smoky widget
#

Thanks! yeah i didn't have much rellevant code to show, I was just wondering if there was any. I think there's some stuff about vectors being or not normalized returning diferent results on GPU or CPU

#

It ended up being a diferent issue ๐Ÿ™‚

dim yoke
lusty smelt
#

I have a simple shader that makes some rectangles. Do you know how to increase the spacing between the rectangles?

lusty smelt
#

its a shine effect for pickup object

#

it looks decent already, but I wanted to increase the spacing between the "stripes" to make the effect more subtle

brave mural
#

@lusty smelt This is for the highlighted area, it scrolls over time and you want a bigger gap between them? I'm not in unity to try now but I think you need to adjust the rectangle. You want either the 0 or 1 to cover more space. Play with the rectangle sizing?

lusty smelt
#

already tried that and it does increase the gap, but also makes the rectangle stretched and it doesnt look that nice. I would be perfect to increase the gap without changing stripes width

brave mural
#

Do you have video clip of the effect with how it is now and what was bad?

lusty smelt
#

Figured it out ;) I changed the Y tilling and then adjusted the size of the box

steel notch
#

If I want to get the position of the actual object in shader graph, what are my options?

#

Just pass it in via script?

regal stag
steel notch
#

Trying to make a pie chart.

#

So taking a cylinder and cutting it with alpha clipping.

final path
#

Does anyone know how to do this in shader graph so that the noise effect below is performed equally on "standing" walls (it goes from top to bottom without stretching)? Similarly on the top and bottom walls.

kind juniper
snow forge
#

Mornin all, would anyone know if such a thing as Tesselation for URP Shadergraph exists? Maybe a custom function? Had a look around but the only things I can find are HLSL Shaders that don't really do what I need. I did think about looking converting the tesselation part into a custom function, but I know nothing about HLSL, so pretty much a non-starter. ๐Ÿ˜•

brave mural
#

I'm trying to recreate the analog channel change effect for swapping between two textures on a retro tv like they do here in premiere: https://www.youtube.com/watch?v=Tbk9GwoTUNA

It's a work in progress but coming out nicely.

Try Epidemic Sound 30 Day Free Trial : https://share.epidemicsound.com/9ulrss

Looking to Buy Premiere Pro?
https://clk.tradedoubler.com/click?p=265883&a=3281779

My Filmmaking Gear :
The Best All Around Lens for APsC Camera's :https://amzn.to/3Jvac0u
One of the Best Budget Camera's Ever Made: https://amzn.to/3YEHqPs
The Best Cage for the BMP...

โ–ถ Play video
hollow swift
rare wren
#

I am doing some experimentation to 'blow up' models in a full screen shader graph.
Here I want to extrude all objects in a scene along their normals. I tried to take the position and add the normal to it, but this did not work in a full screen graph as that is just color data.

Another idea I had is to slightly enlarge the normal UVs, so it kinda zooms in. This does not work the best sadly, so I wondered if someone here has smart ideas

kind juniper
rare wren
grizzled bolt
#

It doesn't seem possible in a full screen shader since all the meshes are rendered already

#

Screen space outline shaders have to work in a bit of a different way

kind juniper
rare wren
#

Ah yeah fair enough
I wanted to add this as a post processing effect and have it interact with a screen space fog solution this way

kind juniper
#

You can render to a stencil buffer or something and use that in the fog shader.

rare wren
# kind juniper Interact in what way?

Have fog not render if you look right next to objects. So the scene fills with fog and then if you look next to a house there is a small offset for the fog. Just using depth does not cut it, so I am trying to get it working with the position and normals now

kind juniper
#

Wdym by "look next to an object"? Look directly at them? Or look somewhere else, while standing next to them?

grizzled bolt
#

Fog "offset"?

tacit parcel
hardy agate
civic lantern
snow forge
# civic lantern Meant to reply to you

Yeah from everything I've seen Tesselation isn't natively a part of URP which is a pain and a half. And every tesselation shader I've found for URP is HLSL.

Buuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuut.

I've just had an intriguing thought (I was hoping to use tesselation for an ocean shader)............but may if I used a 'flat' terrain (because it has dynamic subdivision), that my be the way to go with a general vertex displacement?

civic lantern
#

Sounds like a hack but maybe it's worth trying

snow forge
civic lantern
#

Not sure if terrain shaders support vertex displacement but maybe

rare wren
#

Terrain takes up a good chunk of performance tho. Having LODed high poly quads with the water movement being in world space might be a lot more performant

#

URP can just batch them together if they use the same material/shader

civic lantern
#

Yeah, was thinking that. Just need to make sure that the seams between different LODs dont have gaps

rare wren
#

Make the edges higher poly than the middle parts maybe?

civic lantern
#

In theory it might not be noticeable if the further meshes would displace less

civic lantern
rare wren
#

Or you can make the simulation world space, but have the water 'follow' the player. This way you have just 1 object with a high poly center and lower poly outsides

#

That's how games most often fake infinite water

snow forge
#

Yeah I did look at using planes, but tbh, the concern about that is the sheer amount of them I'd need and the polys counts on each of them when the player is close.

civic lantern
#

I doubt that terrain would be any more performant

rare wren
#

Feel free to try both of course, but in general I steer away from terrains except for rapid prototyping

snow forge
#

Was looking at this video specifically.

https://www.youtube.com/watch?v=FbTAbOnhRcI

Hello and welcome to, like, the 10 millionth water tutorial Iโ€™ve done. In this weekโ€™s video weโ€™re looking at some more in-depth Unity Shader Graph features to make water, or an ocean, with shoreline/edge foam, depth, and waves.

Shader is compatible with HDRP., Edit: it used to be compatible with LWRP but Unity changed something. I'll update t...

โ–ถ Play video
rare wren
snow forge
#

Yeah, pretty big area to cover. lol.

#

Would be much easier if they implemented Native water into URP. lol.

past ginkgo
#

Why can the box be seen from some angles and from some it cant

#

the black walls

#

i wasnt sure where to post this sorry

hybrid sparrow
# past ginkgo

Is this box made of multiples meshs ? Or a material per face ?

past ginkgo
#

I used the same box as the one on the left of it and deleted the front face

#

i made it in blender

#

the whole thing is just made out of one material

hybrid sparrow
past ginkgo
#

I have the same problem here as well hold on

#

its with a lot of objects

fast shore
#

What's the best way to achieve similar "fake ambient occlusion" in 2D?

#

At first I thought to just make the walls glow around contour (similar to how blurred outlines work) but I will have cases where the floor should be perceived as being way below the wall (like on a bridge) in which case I wouldn't want the walls to glow black all over the open space

#

Ideally it's the floor that gets darkened when cornering a wall, not the other way around, but I'm open for suggestions

#

Alternatively I guess I could pass in the wall shader which side it's supposed to glow dark

#

And cut off sides that shouldn't simulate ao

grizzled bolt
past ginkgo
#

alr thank u

desert orbit
#

Are you using tilemaps for this? @fast shore

#

In that case would be easy to make them separate tiles in Tilemap, you can control them with rules.

fast shore
#

And wall chunks are combined into a single mesh

#

Also even with tilemap I don't see how that would've helped

desert orbit
#

You can also draw bridge elements with higher render order to cover those

desert orbit
fast shore
final path
hybrid sparrow
#

Hello, I have a question about an MR project, it's an Apple Vision project that has an AR part and a VR part. At one point I have to deform the environment like this, it works in editor, but not in build. To do this, I use the scene color node. But as my project is configured to be in MR, I think it won't work... Is there another way of achieving this effect without using scene color? Or with a shader designed for MR projects?

odd hedge
#

In Shader Graph, there is a scene-color node. What is the shader lab / hlsl equivalent? Is it possible without using a render texture? Please tag me if you have an answer, thanks :)

grizzled bolt
odd hedge
#

And for srp?

grizzled bolt
odd hedge
#

No I mean urp

regal stag
odd hedge
regal stag
#

It's already in the project if using URP. But you can only include it if the code is written specifically for URP - using HLSLPROGRAM and universal includes, not CGPROGRAM / UnityCG.cginc.

quaint grotto
#

pow(f, e) will not work for negative f

why cant we use negative numbers ?

odd hedge
tacit parcel
quaint grotto
#

thats the error i get, according to unity docs pow with negatives produces NaN

kind juniper
#
The result of a complex number arises when raising a negative number to a non-integer power due to the properties of exponents and roots. When you raise a negative number to a fractional power, you're essentially calculating the square root of a negative number, which is not defined within the real numbers.
quaint grotto
#

shame they cant add support to return a float2 so you can get complex numbers if you needed it

kind juniper
#

That would require new hardware that is capable of that, as well as changing the API specifications.
Something like that would blow up all the related infrastructure.

quaint grotto
#

pow and ipow ๐Ÿ˜

inner birch
#

Hi! Does someone know how to make a smear effect ( anime style speed deformation effect)? Its a very popular fx

#

I contacted creator of Realtoon shader and he also think it would be a great addition but he need some kind of guide code for it.

grizzled bolt
#

Their issue is making it work with skinned mesh renderers specifically

#

The effect itself is quite simple
A script stores an earlier position of the object
Shader offsets some of the vertices towards that earlier position's direction, masked by noise and normal direction to offset direction

brazen nimbus
#

Hello there! I'm looking to use baked lightmap information in shader graph (using URP !) to get a mask that separates the bright from dark of my scene. Any suggestion about how to do this ? I still can use x sample texture node as parameter and go from there but I'm pretty sure there's better way to do this ! I've seen some "2D light texture" node for example but still finding how does it work and if it's really relevant for my using !
Thanks in advance !! ๐ŸŒบ

buoyant zenith
#

Hello !
I made a custom shader in which I made a function to recalculate UVs as quadbilinears. I am using double (64 bits) values for high precision calculations. In AMD & Nvidia GPUs I am using it works well but in a Intel Arc A770M it doesn't work out. How am I supposed to know if this GPU supports 64 bits ? Is there some concrete documentation or information to understand that ?

shell wadi
inner birch
#

There is only one shader in the asset store that do smear effect but it is not a toon one and my project already rely on realtoons shaders

chilly robin
#

I realized I don't actually know how texture samples work. Outside of memory usage, is there a difference between sampling a 4x4 texture versus a 4096x4096 texture? I can only assume that there is, but where is that measured, if anywhere?

strange basalt
#

larger texture and your fragement shader will execute more times

#

should not be a huge deal, but it does mean if you got something really complex going on and it can be done in the vertex section instead its better to do it there

strange basalt
#

i might be thinking about it from the wrong coordniate space, but because it executes for every pixel in the object

dim yoke
#

It does execute for each pixel of the mesh, not each pixel of the texture

strange basalt
#

yeah was thinking about it in the wrong coordspace sicne it would be in clip space at this point in time

#

so just for fragements that are on the screen

dim yoke
#

@chilly robin So there shouldn't be any or atleast big difference in the sampling times between texture sizes. Larger textures just eat more memory which results in more data transfer. If your video memory is a limiting factor there will be even more data transfer between RAM and video memory which is suboptimal, the shader execution time itself shouldn't make a difference afaik, feel free to correct me if there's a factor that I have forgot though

chilly robin
fast shore
#

Wow. RenderDoc is pretty nuts if you wanna see how stuff is actually rendered

#

I didn't know you could just record all the passes from basically anything and play it back

chilly robin
#

It's pretty neat

fast shore
#

It also gave me an insight that fake 2D AO, in a lot of cases, does not involve glowing walls ๐Ÿค”