#archived-shaders

1 messages Β· Page 63 of 1

regal stag
#

VertexAttribute.Position will map to POSITION semantic, not SV_POSITION. I don't know anything about the custom layout, but I would assume you just need to override the "appdata_base" with a custom struct so you can use uint rather than float3. Maybe others can clarify if that's wrong.

SV_POSITION is only used as the clip space vertex shader output (in "v2f" struct). It's used during rasterization.

heady horizon
#

Oh ok sick

#

So I'll still be using SV_POSITION to communicate to my frag shader, but when I write my custom layout, the attribute I'm referring to with VertexAttribute.Position would be the POSITION semantic, so I would use that semantic to stream in my custom packed data is a custom appdata-like struct

#

That makes a lot of sense man, thank you for clarifying!

loud dagger
#

Hello! How can I use one tiling parameter for all of my textures similar to the standard Material. Making this shader in Shaderlab

regal stag
# loud dagger Hello! How can I use one tiling parameter for all of my textures similar to the ...

Can add [NoScaleOffset] before any texture properties where you don't want the Tiling & Offset fields to appear. You could do this for all textures except the main/base map for example.
(Alternatively look into writing a Custom Shader GUI if you want full control over how the inspector looks)

In your vertex shader, you'd use the uv = TRANSFORM_TEX(uv, _TextureName) macro to apply that. Or for surface shaders, use uv_TextureName in the Input struct.
Would just use this same uv variable to sample all your textures to make them share the same tiling/offset.

#

If you want to use a custom tiling and offset fields that aren't attached to a texture property, could instead use two Float properties or a Vector property.
In the shader you'd use uv = uv * tiling + offset; to apply that. It's the same calculation the TRANSFORM_TEX macro is doing.

narrow stirrup
#

Is there a way to create a reusable color asset in unity? The goal is to take multiple sprites and change the color on all of their sprite renderers at the same time from a single source in the Unity editor.

shadow locust
#

assign it to all of them

#

and change the material

humble tide
#

thank you! i've made the all add to themselves and i thought they were working but now i'm getting very weird artifacting

#

anyone seen something like this before?

#

oh okay so this is happening

#

the first two lights seem fine but the third confuses it

#

i think it's the shadow atten, the mainlight function gets it through this

            float4 shadowCoord = TransformWorldToShadowCoord(positionWS);
            
            #if VERSION_GREATER_EQUAL(10, 1)
                ShadowAtten = MainLightShadow(shadowCoord, positionWS, half4(1, 1, 1, 1), _MainLightOcclusionProbes);
            #else
                ShadowAtten = MainLightRealtimeShadow(shadowCoord);
            #endif

            Light mainLight = GetMainLight(shadowCoord);
            Direction = mainLight.direction;
            Color = mainLight.color;
            DistanceAtten = mainLight.distanceAttenuation;
        #endif
#

although it's still getting it so i'm not sure

buoyant oriole
#

just wondering, it is possible to cull vertices in the shader graph?

alpine terrace
#

Currently trying to get a shader that creates a cardboard outline on stuff.

halcyon panther
untold vortex
#

I cant seem to get the texture coord for the 2nd uv?
Its gives me 0,0,1,0 always.


            struct appdata_t
             {
                float4 vertex        : POSITION;
                fixed4 color        : COLOR;
                float2 texcoord0    : TEXCOORD0;
                float2 texcoord1    : TEXCOORD1;
            };
#

I want the 2nd texture to not follow the main texture UV, but texcoord1 never seem to return the HollowUV texcoords.

regal stag
kind juniper
untold vortex
#

Its a texture.

#

Ok i think i know where i am messing up

regal stag
untold vortex
#

Its on a Unity Image component.

regal stag
kind juniper
regal stag
#

Yeah probably the same as SpriteRenderers

regal stag
untold vortex
#

I shall try to get an example so i can understand better too πŸ™‚ Thanks for helping

#
            fixed4 frag(v2f IN) : SV_Target
            {
                half4 atlasOffset = _IconRect * _MainTex_TexelSize.xyxy;
                half4 offset = _TestRect * _HollowUV_TexelSize.xyxy;

                half4 tex = tex2D(_MainTex, IN.uv);
                half4 hollow = tex2D(_HollowUV, IN.uv);
                half4 key = tex2D(_KeyIcon, hollow.rg);
                
                half3 hollowColor = lerp(tex.rgb * IN.color, key.rgb, hollow.a);
                half4 color = half4(hollowColor, tex.a);
                color.a *= IN.color.a;

                #ifdef UNITY_UI_CLIP_RECT
                color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
                #endif

                #ifdef UNITY_UI_ALPHACLIP
                clip (color.a - 0.001);
                #endif
                return color;
            }
#

This works in prefab view πŸ‘ but when i press play it just doesnt want to render the image properly anymore.

#

I think i understand why now. The original main sprite is part of a texture atlas, so the UV is πŸ’©

#

Could that be the reason?

regal stag
untold vortex
#

I'll try it later, over the time limit i can spend on this sadly.

young marten
#

How do I do specular with 2d lighting?

buoyant oriole
regal stag
buoyant oriole
#

Alright ill have a go at that and that will probably work in the shader graph too
Ill test it in the morning tomorrow thanks for the help πŸ™‚

grand jolt
#

Why the heck

#

Is my game

#

Not working

#

I am using Universal RP, with default-lit shaders on each asset

#

It's 2D, but for some reason even though I have no light, the scene does not go black?

young marten
#

All I can get in shader is light texture, which doesn't contain any information about direction of lighting

grand jolt
#

Huh?

young marten
grand jolt
#

cool

young marten
#

But in your case I would advise you to add a very dim global light

#

it works for me

#

or just any light at all

grand jolt
#

Huh?

#

But then the spotlight doesn't work

#

Sprite-Lit-Default

#

mb

grand jolt
#

The light 2d

#

Won't let it show

young marten
#

You'e showing a 3d light in this case

grand jolt
#

Huh?

#

OMFG

#

THANK YOU SO MUCH

young marten
#

so I'm not sure what's your problem here

#

Any one know how to do specular with light 2d in unity?

#

Guess I'll have to modify the rendering with something other than shader now...

grizzled bolt
young marten
#

But it seems that it's not enough

grizzled bolt
#

You only have access to the light texture, so to fake it I assume your only option is to modify the output of the light texture somehow to make it seem sharper based on a smoothness value

young marten
#

Probably I can fake a similar effect with a drawn specular effect

#

To make some certain spots can have highlight when the direction of light is around somewhere good

humble tide
#

i've had a look at a few other examples of forward plus light loops and it seems most of them don't add the atten to themselves, that said most of them don't have attenuation as its own value so it's kinda hard to tell

#

but i found a unity forum post that did this

#if USE_FORWARD_PLUS
    for(uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++)
    {
    Light light = GetAdditionalLight(lightIndex, WorldPosition);
        half NdotL = max(0, dot(WorldNormal, light.direction));
        half atten = light.distanceAttenuation * light.shadowAttenuation * GetLightIntensity(light.color);
        half thisDiffuse = atten * NdotL;
        thisSpecular += LightingSpecular(thisDiffuse, light.direction, WorldNormal, WorldView, 1, Smoothness);
        Diffuse += thisDiffuse;
 
        Color = (thisDiffuse > 0 && GetLightIntensity(light.color) > maxIntensity) ? light.color : Color;
        maxIntensity = (thisDiffuse > 0 && GetLightIntensity(light.color) > maxIntensity) ? GetLightIntensity(light.color) : maxIntensity;
    }
#endif
#

and the attenuation is reset every time so it can be multiplied together for the diffuse

#

maybe i can handle what the graph's doing to the attenuation through script? though i don't know how to handle the dot product and normal vector and whatever

#

damn that just made it worse

#

the third light throwing everything off is just so confusing, i don't understand why it would work for 2 and not 3

long sand
#

What does Unity shader warm up actually do on a player? Does it compile shaders? If so why aren't they cached in the device and compiled only once? Please shed some light I am confused again.

young marten
#

I guess I could just store the information of all lights with a c# script, and send it to the shader as uniform

humble robin
#

help Blitter.BlitCameraTexture(cmd, source, dest, mat) and Blit(cmd, source, dest, mat) returns a black screen while cmd.Blit(source, dest, mat) works properly

#

why could it be?

#

i thought cmd.Blit(source, dest) and Blit(cmd, source, dest) was the same thing

#

also, i am (almost?) sure it is not related to the variables passed on to shader

#

i tried making frag output just white

#

it still worked with cmd.Blit() while the other two produced a black screen

hearty obsidian
#

I'm doing heavy calculations for vertex displacement. I need the new normals at fragment stage. Is there a workaround other than recomputing everything in the fragment stage?

regal stag
long sand
#

my understading is that you need to compile it on the GPU where it runs, unity compilation may just be about preprocessing

#

but I would like to be proved wrong

#

so unity transform to bytecode, but does the bytecode need to be compiled on the gpu (to become native instructions)?

#

i have never really understood how it works on a GPU, it's easier on CPU

regal stag
#

The page I linked does mention

The graphics driver creates a GPU-specific version of the shader variant and uploads it to the GPU.

long sand
#

right

#

so that is not just about uploading something precompiled

#

some games do precompile and cache locally and it appears that warmsup does the same on some devices

regal stag
nova needle
#

How would you render gras for something like a strategy game? Bilboards look quite fake at that angle, right?

humble robin
#

i was almost sure shader wasn't the real problem here so i was debugging wrong things

#

i fixed it now

neon oyster
neon oyster
nova needle
#

Thanks! Really nice thread

golden rose
#

I'm working on a game with procedurally generated dungeons, and I'm wondering if anyone has tips on how I would implement a fog of war? I'm not exactly sure how to implement it so any tips would be great!

neon oyster
#

But to make it more pleasing, find a better tutorial on how to draw a real fog or volumetric cloud may look nice.

golden rose
alpine terrace
# alpine terrace Currently trying to get a shader that creates a cardboard outline on stuff.
#

Currently searching alternatives.

grand jolt
#

What's a nice way

#

To improve on this with more shaders?

kind juniper
#

more shaders?😱

#

Where are you gonna put them?

grand jolt
#

Idk?!?!?!

#

I wanted to add some cool effects!!?111!11

#

With shaders?!?!

#

Any ideas?

kind juniper
grand jolt
#

I wanna make it pop

kind juniper
#

You'll need to come up with more concrete explanations. There's no "pop" shader in unity.

grand jolt
#

AH sure

olive inlet
#

how should i convert the color node a texture

grizzled bolt
cloud orchid
#

Is it not possible to pass a modified world position to a Triplanar?
Nothing seems to affect the projection

grizzled bolt
heady horizon
heady horizon
#

uyuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuugh

#

I'll create a default unlit and compare

#

i thought all that stuff was useless and deleted it

regal stag
#

Usually you can remove it (depends if you actually need to support fog or not). Though you still have #pragma multi_compile_fog which might be messing with things

heady horizon
#

Tried to remove that too, didn't work

#

wait, it happens to any unlit shader i create by default

civic lantern
#

So fog renders in front of everything?

heady horizon
#

Yeah?

#

Object using an unmodified default unlit surface shader

heady horizon
#

Hmm, this is in HDRP, wonder if that's causing issues

civic lantern
#

Is there a reason you are not using shader graph?

#

I haven't had any issues in HDRP, though I haven't used text-based unlit shaders. Just shader graph

regal stag
civic lantern
#

@heady horizon Yeah I'm pretty sure you are not supposed to use that Unlit shader in HDRP

#

HDRP has its own sub menu

heady horizon
#

Good thing my actual projects in URP

heady horizon
#

thanks man

#

uhh i dont think i have the latest version lmao

civic lantern
#

I might be on an old version too. What's your HDRP version?

#

I'm on 11.0

#

Which is from 2021

heady horizon
#

is this it?

civic lantern
#

Package manager > High definition RP

heady horizon
#

Yeah

spiral bay
#

Anyone in here working with the URP UTS Toon Shader?

#

Did someone manage to add a dissolve effect to it?

north spear
#

how do I convert a roughness greyscale map and a metallic black and white map into one of those red and alpha maps for the unity standard shader?

grizzled bolt
# north spear how do I convert a roughness greyscale map and a metallic black and white map in...

You could do it in an image editor that has channel editing like PS or Gimp, but consider gamma correction as the metallic map is not an sRGB image
There are channel packer plugins for Unity to be found but each of them is a bit quirky in their own way
Tools like Substance Painter have export presets for many different Unity's texture formats, probably including BiRP mask maps
You can also make such a tool yourself with Blender's compositor that can mostly automate the process and save with the precise image settings needed
This is an #πŸ”€β”ƒart-asset-workflow question unless you're looking to make a shader that samples the textures separately, which is not usually a great option

tardy field
#

I want to make an outline for the effect you see on the screenshot. By that I mean not the outline aorund the sphere but around the red effects that are happening on the sphere. What you see here is just a simple voronoi noise slightly modified, twirled and animated through tilling offset and time. I don't how to tackle this outline effect, and I am not even sure how to google it. So any ideas, links to tutorials or hints are most welcome

chrome smelt
#

Does anyone know why tiles with normal maps look normal in the scene view and blurred in the game view?

#

fixed it, sorry for spam

grizzled bolt
#

The width cannot be very consistent though due to the distortion

tardy field
tight phoenix
#

The stock 'StencilDeferred' shader that unity autogenerates for the URP pipeline throws 1000s of errors per frame in Logcat.

2023-11-08 16:50:16.476 16881 16909 Error Unity 
2023-11-08 16:50:16.510 16881 16909 Error Unity Shader Hidden/Universal Render Pipeline/StencilDeferred, subshader 0, pass 7, stage all: variant <no keywords> not found.
2023-11-08 16:50:16.510 16881 16909 Error Unity UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderSingleCamera(ScriptableRenderContext, CameraData&, Boolean)
2023-11-08 16:50:16.510 16881 16909 Error Unity UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderCameraStack(ScriptableRenderContext, Camera)
2023-11-08 16:50:16.510 16881 16909 Error Unity UnityEngine.Rendering.Universal.UniversalRenderPipeline:Render(ScriptableRenderContext, List`1)
2023-11-08 16:50:16.510 16881 16909 Error Unity UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal(RenderPipelineAsset, IntPtr, Object)
2023-11-08 16:50:16.510 16881 16909 Error Unity 
2023-11-08 16:50:16.510 16881 16909 Error Unity [ line -436001304]```
This every frame - do you know what its trying to say or how to make it stop erroring? We tried just deleting it but that didn't resolve the issue
#

the device throwing this error in log cat is a samsung galaxy A14 if that matters

neon oyster
chrome smelt
#

I fixed it by setting the Render Scale of the Light Render Texture in Universal Render Pipeline Asset_Renderer from the default of 0.5 to 1.0. Thanks tho

golden rose
#

How can i make this not tile super poorly ?

humble robin
#

hey, is there a way i can use the same lights for 2d and 3d objects at the same time on forward rendering path?

#

previously i was rendering 2d sprites that also had normal maps and 3d models to gbuffer

#

its a platformer with orthographic camera so accurate depth-sorting doesn't really matter

#

any possible ways to do this without relying on g-buffer?

#

maybe i could create a 2d and 3d light on the same place for lights but i'm worried about them looking different or incompatible

karmic hatch
grim bloom
#

Is there something more effective than this? I want to hide player model but it's shadow should be still visible. Currently I use shader with alpha 0 but I heard that it is bad because transparent materials required more draw calls

grizzled bolt
humble tide
#

i thought i was done with the shader graph finally and have now noticed that objects don't cast shadows from additional lights

#

i don't even know where to start with this

humble tide
#

@regal stagdoes your additionallights function handle casting shadows with additional lights?

grim bloom
vestal venture
#

Why can't I choose pipeline?

humble tide
#

you need to create one in urp global settings

tardy field
#

My shader graph gets black when overlaying another material that has any amount of bloom on it. It's hdrp project, with an unlit shader. In the center of screen the shader covers just a simple material with bloom on it. In top left corner, it covers itself and a vfx graph particle that simply just reflects some light. I assume there is some setting that causes it either in hdrp or shadergraph, but I am unsure what to look for

amber saffron
toxic flume
#

Is it more efficient to use 2d-3d texture instead of buffer for cellular based water simulation?
I have implemented it with structured buffers.
Others say 2d-3d textures are more efficient for 2d-3d data because of caching

tardy field
long sand
regal stag
# long sand would anyone be so kind and knowledgable to be able to help me with this puzzle?...

I'm not 100% sure, but my understanding is that tickbox doesn't toggle a keyword, but the Material.enableInstancing bool, which might then be interpreted later during rendering objects (or Graphics.DrawMeshInstanced calls etc)
But if you're in URP/HDRP, the SRP Batcher takes priority so renderers may be put into SRP Batches instead, assuming the shader supports it - can see it's compatible in one of your screenshots. Frame Debugger window would also tell you how they are being rendered.

snow forge
#

In shadergraph, Would anyone know how to blend two textures together (terrain shader) based on the slope of the geometry? Can't seem to get my head around the maths.

regal stag
snow forge
regal stag
regal stag
long sand
snow forge
regal stag
long sand
#

wow

#

thanks

humble tide
#

just confusing cause my additinal lights script's pretty much the exact same as yours minus the shadowplane or whatever it's called

regal stag
humble tide
#

shadow mask that's it, and yeah i'd replaced all the shadowmask parts with half4(1,1,1,1), i'll just double check i had it in the right place

#

oh no i'd removed it at some point, i'll try that tomorrow cheers

long sand
#

"multi_compile_instancing generates a Shader with two variants: one with built-in keyword INSTANCING_ON defined (allowing instancing), the other with nothing defined. This allows the Shader to fall back to a non-instanced version if instancing isn’t supported on the GPU."

#

so if I set it in the material, it should defo enable the keyword

#

I do wonder however if the problem is the SRP_BATCHING

#

it does indeed mean that all the INSTANCING_ON variances should be ignored

#

my god

#

even if I disable SRP batching the instancing_on keyword is not among the material keywords 😦

#

but as you say maybe it's by design and just used at run time who knows

hollow sentinel
#

Any way to disable Full Screen Shader Graph in "Scene view" and not in Game View?

wild marlin
#

Why is my shader not working on the box on the left? (something part of a blender model fbx) when i try to apply the same shader its just transparent

regal stag
wild marlin
static shore
#

How do I make the Base Map, Mask Map and Normal Map exposed and functional in my shader graph shader?

#

Right now my shader only has a functional Main Texture

wild marlin
tight phoenix
#

How do I take whatever a spriteRenderer is doing here and make use of it on 3d models?
I need the ability to set colors on a per game object basis, without breaking batching or whatever else πŸ€”
I cant find any doccumentation that explains whatever special thing that SpriteRenderer does to allow it to use a single material and take in color the way it does

#

some places on the net suggest they encode the color into the meshes vertex color but when I tried doing that, I just got angry console errors telling me to write to the SharedMesh

#

which is absolutely not what I want, what I want is whatever spriteRenderer does, exact that

#

I am using URP and shadergraph which further complicates this

regal stag
regal stag
# static shore How do I make the Base Map, Mask Map and Normal Map exposed and functional in my...

You'd need to create those texture properties and connect them to the graph. The normal map can be sampled with the Sample Texture 2D, set to Normal on the type/mode dropdown. Connect to the Normal (Tangent) port in the Fragment stage of the Master Stack.
As for Mask Map, sample with regular mode. Though not sure what channels go where off the top of my head. I think there's a docs page somewhere.

static shore
#

Thank you I appreciate it! If you can find that docs page or have a hint of what the name might be it'd be much appreciated!

regal stag
static shore
#

HDRP, I'm making a shader for cutting out a circle through walls when something blocks my camera from seeing my player

regal stag
# static shore HDRP, I'm making a shader for cutting out a circle through walls when something ...

Ah yeah, this is the page that shows what each channel contains in the mask map - https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@16.0/manual/Mask-Map-and-Detail-Map.html

Red Metallic
Green Ambient Occlusion
Blue Detail mask
Alpha Smoothness

I think the references used by the properties is _BaseColorMap, _MaskMap and _NormalMap. Looking at the Lit.shader shows these. Using the same references will make sure the values are kept if the shader is swapped - https://github.com/Unity-Technologies/Graphics/blob/master/Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader

static shore
#

Awesome, thank you!

heady horizon
#

I want to define an small array of constant/static normal vectors in my shader, which I can quickly and efficiently access in my vert function

#

Should i use a cbuffer?

heady horizon
#

Also how do I get the main light direction in hlsl?

humble robin
#

just sampling normal map and maintex on a plane was enough

tardy field
#

So, I created this arrow using a rectangle node. Now I want to create a second and third arrow just like that but each one slightly behind the previous one. Is there a better way to do this than to simply duplicate this whole node section and change the values?

tardy field
# neon oyster subgraphs

Ahh yeah, but that will only spare me some space visually, I am worried about the performance as well though

rapid terrace
#

if i were to for example use the shadergraph to make a 2d image rotate, is it possible to bake that into a spritesheet within unity

regal stag
#

Alternatively could use a texture - if you use gradients (like the preview in the Absolute node) and then Step/Smoothstep in shader, the texture won't need to be that high res too.

regal stag
tardy field
regal stag
heady horizon
#

Ahhh thank you so much

#

I’m using URP and was wondering why _WorldSpceLightPos0 wasn’t working

ebon moss
#

I am racking my brain trying to figure out how to get time to start at 0 in shader graph. Anyone have any ideas?

#

Ideally without adding any external script

humble tide
#

the half4(1,1,1,1) thing didn't work unforch

#
void AdditionalLightsToon_float(float3 WorldPosition, float3 WorldNormal, out float3 Direction, out float3 Color, out float Attenuation, out float Output)
{
    float3 direction = 0;
    float3 color = 0;
    float output = 0;
    float attenuation = 0;

#ifndef SHADERGRAPH_PREVIEW
    uint pixelLightCount = GetAdditionalLightsCount();
    uint meshRenderingLayers = GetMeshRenderingLayer();

#if USE_FORWARD_PLUS
    for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++)
    {
        FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK
        Light light = GetAdditionalLight(lightIndex, WorldPosition, half4(1,1,1,1));
#ifdef _LIGHT_LAYERS
        if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
#endif
        {
            direction = light.direction;
            color = light.color;
            attenuation = light.distanceAttenuation * light.shadowAttenuation;
            float3 saturatedValue = (saturate(dot(direction, WorldNormal))) * color * attenuation;
            output += saturatedValue;
        }
    }
#endif

    InputData inputData = (InputData)0;
    float4 screenPos = ComputeScreenPos(TransformWorldToHClip(WorldPosition));
    inputData.normalizedScreenSpaceUV = screenPos.xy / screenPos.w;
    inputData.positionWS = WorldPosition;

    LIGHT_LOOP_BEGIN(pixelLightCount)

    Light light = GetAdditionalLight(lightIndex, WorldPosition, half4(1, 1, 1, 1));
    #ifdef _LIGHT_LAYERS
        if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
    #endif
        {
            direction = light.direction;
            color = light.color;
            attenuation = light.distanceAttenuation * light.shadowAttenuation;
            float3 saturatedValue = (saturate(dot(direction, WorldNormal))) * color * attenuation;
            output += saturatedValue;
    }
    LIGHT_LOOP_END
#endif
    
    Direction = direction;
    Color = color;
    Attenuation = attenuation;
    Output = output;
}
#

i do get where the shadows are removed by the additional lights but objects don't cast shadows with them

#

i get them from the mainlight thoguh

#

i'm using the _FORWARD_PLUS, _ADDITIONAL_LIGHT_SHADOWS _ADDITIONAL_LIGHTS, _MAIN_LIGHT_SHADOWS and _MAIN_LIGHT_SHADOWS_CASCADE boolean keywords, all multicompile and global and set to true by default

pine plover
#

this shadow here has the transparent shader (Legacy Shaders > Transparent > Specular) and its still like this

#

can someone please help me fixing this?

#

this is new and i dont know how to fix it

pine plover
#

nvm

#

got it fixed

#

it was the texture that had problems

north kiln
#

why isn't the texture showing

strange moth
#

or built in?

north kiln
#

i thin kit's built in

#

it comes with the file i downloaded on unity 3d

humble tide
#

you might need to convert it to urp if you are using urp

north kiln
#

how do i convert, sorry i'm new

#

where do i check?

humble tide
#

i think it's under edut, rendering, convert to urp

humble tide
#

edit>rendering>materials>convert to urp

#

and you have to highlight the material

grand jolt
#

Hey guys, I'm starting to learn how to use shaders, and for some reason when I create a simple shader and put it on my player gameobjetc, the texture changes in a weird way, it's like it's trying to remove the transparent pixels, how can I fix this?

karmic hatch
#

(Are you sure you are applying the alpha correctly? If it's shadergraph, you need to put the alpha in the alpha node, which is separate from the base color)

grand jolt
#

Bro this is already too difficult for me, this is my first (working) shader.
Yes, it's a shader graph, but I don't know how to apply the alpha

grand jolt
karmic hatch
#

You just need to insert the alpha from your texture sampler to the alpha in the fragment

grand jolt
#

Okay so I did find the fragment node and the alpha, where right now the value is 1

#

What should I do now?

regal stag
# grand jolt

Connect the alpha channel (A output of the Sample Texture node) to the Alpha

grand jolt
#

Oh okay understood

rocky totem
#

this is my shadergraph and its output. how can I make the black background transparent?

grizzled bolt
karmic hatch
#

(might be what you want ofc, but usually isn't)

sterile wind
#

i have a basic shader problem and was wondering if someone could help me,

i am using the and node to determine a boolean value for the base colour (true is being my damage flash effect for enemies and false being my dissolve shader for the enemy death) i set one input to always be 1 and its unaffect by any code and i set the other to 1 or 0 depending onw here im calling it in the script, and it doesnt seem to listen to the int inputs and jsut decided to always return false

#

here is my shader graph and releivant code

//this is for one script and is only called when the death parameters is met
private void SetFlashBool()
    {
        for (int i = 0; i < _materials.Length; i++)
        {
            _materials[i].SetInt("_FlashBool", 0);
            Debug.Log("SetFlashBool");
        }
    }
//this is called in awake 

 private void SetFlashBool()
    {
        for (int i = 0; i < _materials.Length; i++)
        {
            _materials[i].SetInt("_FlashBool", 1);
            Debug.Log("SetFlashBool");
        }
    }
}
rocky totem
regal stag
# sterile wind i have a basic shader problem and was wondering if someone could help me, i am...

What about the "FlashNoContactBool" property, I don't see that being set here. As it hasn't got the green dot next to the property, you've set it as not exposed - which means you should set it via Shader.GetGlobalFloat/Integer. Global properties always default to 0 if not set, since they aren't serialised by the material.

Also :

  • While Float properties might work, you can also add Bool properties in the SG blackboard.
  • Should also use Material.SetFloat or Material.SetInteger, not SetInt which is an older deprecated type that was actually just a float.
tardy needle
#

shader newbie here. I'm trying to change a plane's vertices on Y based on a perlin texture and _SinTime. what would be the best way to achieve this? so far all I have is:

void vert (inout appdata_full v) {
  v.vertex.y += _Amplitude * _SinTime[3];
}
#

and a perlin texture assigned to _Perlin as sampler2D

grand jolt
#

I created a simpler shader just to understand the basics, but still nothing works

#

For some reason even if I connected the alpha from the sample texture to the fragment alpha the player still looks like this:

regal stag
# grand jolt

Have you saved the graph? And can you show the Graph Settings & Material?

grand jolt
#

All the shaders work, but only on squares, any shape that is not a square (so custom textures) for some reason don't work in the right way

regal stag
# grand jolt

Is the object a UI component? Shadergraph doesn't really support UI (unless you use 2023.2 beta as that added a UI graph).
Might be better to use a SpriteRenderer instead, and Sprite Unlit Graph.

grand jolt
#

Okay wtf

#

I just created another shader and I followed the same steps as before and now it's working

#

Bruh I've been all day trying to fix this issue and I fixed it without even knowing what I did

#

This is depressing

woeful breach
#

i found this cool tutorial for a really cheap sub surface scatter effect using the dot product of the view dir and the negated main light dir but for some reason if i change the dir of my main light nothing changes at all does someone know why that could be ?

meager pelican
tardy needle
#

cheers. I ended up just going with shader graph but I'll give this a shot as well and see how it works

humble tide
#

so i got my additional shadows working but they like flicker at different angles

#

they also barely show from most of the lights

serene mist
#

what is the difference between world and absolute world ?

humble tide
#

one worlds absolutely

regal stag
serene mist
#

thank you

halcyon panther
#

I'm new to Shader Graph and I'm trying to create a circle and color it. Can someone tell me what I'm doing wrong here? Lol Btw, the Material is being applied to a Quad Mesh.It's not displaying as a circle in the game and I can't figure out how to add in my color to color in the circle. -_-

torpid mesa
#

Does someone know how to get fullscreen shaders from shader graph to work with single pass instanced VR? I am seeing same image in both eyes. Using URP?

karmic hatch
#

where colorA, colorB, radius, and thickness are all free parameters
The distance(UV, 0.5) tells you the radius from the centre of the quad; when you subtract radius, it goes to zero at r=radius and is negative inside. Taking the absolute value then makes it increase to either side of radius, and subtracting thickness/2 means that the value will be less than zero in a region between thickness/2 on the inside of radius, and thickness/2 on the outside of radius (for a total combined width of thickness).

halcyon panther
karmic hatch
halcyon panther
#

Oh that might actually be it. I'll give it a shot in a few minutes. Thank you. I'm also curious about your first method πŸ™‚

strange frigate
#

Hi! Does anybody knows is it possible to use two vertex color sets in URP shader graph?

regal stag
sharp ginkgo
#

I am using liltoon shaders for VRChat and it seems that the material color is heavily affected by nearby lighting, turning the whole avatar red, blue, etc. Does anyone know what might cause this? I’ve turned off various settings to try and see what it the cause to no avail. There is not any metallic settings active.

strange frigate
serene mist
#

in unreal there is a node to debug my shader, is there something similar in unity?

serene mist
#

thank you I am going to use it

heady horizon
#

I'm using a chain of ternary operators to determine my UV from essentially what is an index

#

Is it more efficient to use chained ternary's or should I just create an array of all 4 possible UV's and do an array lookup?

idle jacinth
#

another way would be to have a const float2 [4] use packedUV as an index

heady horizon
serene mist
#

I thought unreal and unity were similar in terms of shader graph, does anyone know what is the difference between position world in unity and absolute position world in unreal? i thought they were the same, but i get totally different results with the same operation.

regal stag
serene mist
#

yes , you are right

#

I had to divide by 10.24

#

thank you

regal stag
# heady horizon Yes I know that, what I'm asking is if your an array or this is better

Probably not a noticeable difference tbh. And even if there was, it's also possible it could vary depending on platform/gpus.
If you're actually worried about gpu performance the usual thing is to reduce overdaw and combine drawcalls rather than this kind of thing (I guess unless the shader is actually doing something very complex, like in a raymarching loop)

heady horizon
#

That makes sense, thank you

#

I'll just go with the more readable option then

smoky widget
#

So I made this shader, and it's "slow" (it works at around 140fps but i feel like it can run faster). Could someone help me out find what is taking long and what I can do to optimize it further?

#

for example, would this be an error that slows down the shader? I have two of them
"array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll"

willow flower
#

im facing this strange issue where the ui blur only is working in scene view anyone know why this might be happening?

regal stag
#

You should avoid pinging people specifically and wait for someone to answer.
But, you need to pass the position to compare against into the shader, via a Vector3 property (or global one), set from C# using material.SetVector or Shader.SetGlobalVector.
In the shader, compare against the fragment's position in the same space (likely world or object)
That gif is from https://www.patreon.com/posts/19355776 so also see that, or the SG version https://www.patreon.com/posts/26438849

coral matrix
#

Hello, I'm currently trying to implement custom lighting with the amplify shader editor. The lighting works already but I'm struggling to find a way to exclude the lighting calculations in android builds because we need the performance for that platform. At the moment I use the static switch node. In the editor everything is working fine and I can switch between with and without lights through keywords, but when I make an windows build the static switch always outputs the "false" values.
I am setting the keyword like shown in the screenshot in the runtime an every time before the build. The settings are all set and even the Debug.Log displayed that the keyword is enabled. I also tried to work with the fetch mode of the static switch but that didn't work either.
Does someone know how I can archive my goal? Do I maybe have to use another node for that problem? I guess I could work with a function-switch but we I haven't found a way to en- or disable it globally for all shaders through code.
I've read that it is easy to archive throug the shader graph but I have no idea how I would add custom lighting with that one.

regal stag
coral matrix
regal stag
# coral matrix That seems to work. My thought was that I set the keyword before the build to pr...

It shouldn't cost more performance if keyword is disabled, but probably means the file size will be larger since more shader variants need to be compiled.
Though I think you can strip them manually via IPreprocessShaders.OnProcessShader. See :
https://docs.unity3d.com/ScriptReference/Build.IPreprocessShaders.OnProcessShader.html
https://blog.unity.com/engine-platform/stripping-scriptable-shader-variants

Using ShaderFeature might also still work, if you call that function iin editor, before building. (Or might need IsLocal enabled and set the keywords on the Material assets themselves)

coral matrix
shadow locust
low lichen
#

Centimeters

echo lily
#

Do you guys know what is the right way to write to SV_Depth from a custom shader?
I've tried to use the method in this post, but I don't think the output values are right:
https://www.vertexfragment.com/ramblings/unity-custom-depth/

low lichen
smoky widget
#

How can I profile a shader so that I know which instructions are taking so much time? I made a custom terrain shader and is taking around 6ms to run (which doesn't make much sense since it's quite simple)

limber moth
#

can't get my customer shader and code to all work together

smoky widget
#

How can I profile a Shader?

civic lantern
#

Like what is supposed to happen, what code and what shader are you using, and how does it relate to the screenshot?

heady horizon
#

Question about compute shaders:
As I understand it, when you dispatch a compute shader with params Dispatch(kernelID, ,threadGroupsX, threadGroupsY, threadGroupsZ), what you're really doing with the three threadGroups params is outlining how each pass of the kernel will be id'd?

Reason I ask this is because I'm attempting to generate 3d perlin noise, and I read I shouldn't attempt to use a 3d RWTexture and should instead just use a flattened 1d array . I'm trying to figure out what numbers I'd pass into the Dispatch() method for the thread dimension so i can properly index into a 1D array

#

If I want to generate 3d perlin noise for a chunk of 32x32x32 voxels, should I be doin Dispatch(kernelID, 32, 32, 32) ? Is that fine?

carmine spear
#

I think it really just depends how you go about making them in the particle system/shader. It might just be better to go with what's easier to implement/looks better as long as you're not using anything expensive on mobile (like transparency perhaps)

rare wren
#

The most efficient probably is making a shader that can render the waves on a plane. That also probably will be the smoothest.

Particles also should work fine.
Splines could work.
There are some line and shape renderers on github and the asset store

And many more ways to go about it.

For the beginning, I'd say pick the option which is quickest to do while not bringing every device to a halt.

wheat olive
#

How to implement the Base UV Mapping function of HDRP in shadergraph

digital pelican
#

Hey, I'm having issue in URP where transparent is not written to scene color. sphere in middle uses scene color to create difraction. Right space material is opaque, left is transparent. I would require it to be written onto opaque texture in RP. Any ideas?

regal stag
# digital pelican Hey, I'm having issue in URP where transparent is not written to scene color. sp...

This is expected, Scene Color is designed to only include opaque objects.
If you need a texture containing transparents as well, you may need to copy the screen yourself (e.g. blit the screen to your own target and set it as a global texture. Can write a custom renderer feature to do that)
In your diffraction shader, you'd then sample that global texture property instead of using Scene Color. Note : It's important that objects that use this texture are drawn after copying. Can use a Render Objects feature to do this.

digital pelican
#

It's a solution I was thinking, but do you know if this could affect badly performance on mobile over current solution?

regal stag
digital pelican
#

I think I might get away with only render feature with help of stencils

#

Thanks for help

regal stag
#

Maybe another keyword if you need the UV Mapping Space, but that might be kinda messy to setup as you'd need to connect up every option.

wheat olive
#

I got it. Thanks

smoky widget
#

If I have two passes in a shader, will they always be run in succession? Or can I make it so that by default only one pass is run?

hushed silo
#

I’m trying to get a fresnel node working on geo that has vertex displacement going on on it. It only seems to calculate the fresnel from before vertex displacement. Is this expected and is there any way around it?

regal stag
# smoky widget If I have two passes in a shader, will they always be run in succession? Or can ...

Depends a bit. Passes with different "LightMode" tags are rendered in particular orders set by the rendering pipeline. e.g. afaik in Built-in RP "ForwardAdd" should always render after "ForwardBase".
But yes, any passes without tags should be rendered in the order they appear in the shader. I haven't used it but this can toggle whether a pass is enabled or not : https://docs.unity3d.com/ScriptReference/Material.SetShaderPassEnabled.html

Or use a custom LightMode tag, which won't be rendered at all - unless a C# script uses that pass index in Graphics/CommandBuffer functions (or tag value in case of ScriptableRenderContext.DrawRenderers)

For SRPs, I don't think they really do multi-pass. URP can render one UniversalForward and one without a lightmode (aka SRPDefaultUnlit) but it does break SRP batcher compatibility so is better to just use separate shaders/materials and renderers (where render queue determines render order), or a RenderObject feature there.

regal stag
hushed silo
#

(It’s scrolling two soft noise maps over each other)

pliant field
smoky widget
pliant field
# smoky widget Have you tried restarting unity?

yes several times, i even deleted Library if i make new project it works in that it seems some bug in this project, even if i import something from this project to empty project bug also comes in new project

smoky widget
#

Can you explain exactly what are the boundaries of the error? Does it happen only with the multiply node? Or with any node if you right click when holding the line?

pliant field
limber moth
smoky widget
#

If I have two arrays, one is weight and the other represents the original index as such
{0,0.4,0.8,0.2}
{2,5,3,4}

is there any easy way to sort both arrays so that the weights are in order from greater to little
The arrays are actually float4, so mathematical operations work on the pack
currently i have this crazy thing

        void insertSorted(inout int4 indices, inout half4 weight, int newIndice, half newWeight)
        {
            int fourthPlace = step(weight.w, newWeight);
            int thirdPlace = step(weight.z, newWeight);
            int secondPlace = step(weight.y, newWeight);
            int firstPlace = step(weight.x, newWeight);

            weight.w = lerp(lerp(weight.w, newWeight, fourthPlace), weight.z, saturate(thirdPlace+secondPlace+firstPlace));
            weight.z = lerp(lerp(weight.z, newWeight, thirdPlace), weight.y, saturate(secondPlace+firstPlace));
            weight.y = lerp(lerp(weight.y, newWeight, secondPlace), weight.x, firstPlace);
            weight.x = lerp(weight.x, newWeight, firstPlace);

            indices.w = lerp(lerp(indices.w, newIndice, fourthPlace), indices.z, saturate(thirdPlace+secondPlace+firstPlace));
            indices.z = lerp(lerp(indices.z, newIndice, thirdPlace), indices.y, saturate(secondPlace+firstPlace));
            indices.y = lerp(lerp(indices.y, newIndice, secondPlace), indices.x, firstPlace);
            indices.x = lerp(indices.x, newIndice, firstPlace);
        }   
smoky widget
limber moth
# smoky widget Can you show the shader that doesn't work?
Shader "Custom/LightChaser"
{
    Properties
    {
        _MainTex ("Texture", 2D) = "white" { }
        _LightData ("Light Data", Vector) = () // Array to store light information
        _ChaserSpeed ("Chaser Speed", Range(0, 10)) = 1
    }

    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 100

        CGPROGRAM
        #pragma surface surf Lambert

        sampler2D _MainTex;
        float4 _LightData[25]; // Adjust the array size based on the number of lights
        float _ChaserSpeed;

        struct Input
        {
            float2 uv_MainTex;
        };

        void surf(Input IN, inout SurfaceOutput o)
        {
            // Extract light information based on UV coordinates
            float lightIntensity = tex2D(_MainTex, IN.uv_MainTex).r;

            // TODO: Use lightIntensity and _LightData to control the appearance of each light

            // Example: Animated chaser effect
            float chaser = frac(_ChaserSpeed * _Time.y);
            float distance = abs(IN.uv_MainTex.x - chaser);
            float chaserEffect = smoothstep(0.01, 0.05, distance);

            // Combine lightIntensity and chaserEffect to create the final output
            o.Albedo = lightIntensity * chaserEffect;

            o.Alpha = 1.0;
        }
        ENDCG
    }

    FallBack "Diffuse"
}
#

here is my attemtped animation for it too ```using System.Collections;
using UnityEngine;

public class LightController : MonoBehaviour
{
public Material animatedMaterial;
public int lightsCount = 25; // total number of lights
private int[] lightData; // 1D array to store light information

void Start()
{
    InitializeLights();
    StartCoroutine(AnimateLights());
}

void InitializeLights()
{
    lightData = new int[lightsCount];

    // TODO: Initialize the lightData based on your requirements (e.g., bitmap or procedural generation)
}

IEnumerator AnimateLights()
{
    while (true)
    {
        // TODO: Update lightData based on your animation logic

        // Pass the updated lightData to the shader
        Vector4[] vectorArray = new Vector4[lightsCount];

        for (int i = 0; i < lightsCount; i++)
        {
            vectorArray[i] = new Vector4(lightData[i], 0, 0, 0);
        }

        animatedMaterial.SetVectorArray("_LightData", vectorArray);

        yield return null;
    }
}

}

#

like i want these to turn off and on and glow in a circle ring

smoky widget
#

You didn't select the right shader in the material

limber moth
#

wym

smoky widget
#

here it should be custom/lightchaser

#

not Mobile/Diffuse

limber moth
smoky widget
#

search for LightChaser

#

Or otherwise, drag and drop the shader to there

limber moth
#

won

#

won't let me

#

is this emission code even right ```
Shader "Custom/LightChaser"
{
Properties
{
_MainTex ("Texture", 2D) = "white" { }
_LightData ("Light Data", Vector) = () // Array to store light information
_ChaserSpeed ("Chaser Speed", Range(0, 10)) = 1
}

SubShader
{
    Tags { "RenderType"="Opaque" }
    LOD 100

    CGPROGRAM
    #pragma surface surf Lambert

    sampler2D _MainTex;
    float4 _LightData[25]; // Adjust the array size based on the number of lights
    float _ChaserSpeed;

    struct Input
    {
        float2 uv_MainTex;
    };

    void surf(Input IN, inout SurfaceOutput o)
    {
        // Extract light information based on UV coordinates
        float lightIntensity = tex2D(_MainTex, IN.uv_MainTex).r;

        // TODO: Use lightIntensity and _LightData to control the appearance of each light

        // Example: Animated chaser effect
        float chaser = frac(_ChaserSpeed * _Time.y);
        float distance = abs(IN.uv_MainTex.x - chaser);
        float chaserEffect = smoothstep(0.01, 0.05, distance);

        // Combine lightIntensity and chaserEffect to create the final output
        o.Albedo = lightIntensity * chaserEffect;

        o.Alpha = 1.0;
    }
    ENDCG
}

FallBack "Diffuse"

}```

#

says some error

#

ok i got it, but it's definitely not circling around like I want

grand jolt
#

Why is it not displaying my normal map?

Shader "BOOK/NormalMap"
{
    Properties
    {
        _MainTint("Diffuse Tint", Color) = (0,1,0,1)
        _NormalMap("Normal Map", 2D) = "bump" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf Standard fullforwardshadows
        
        #pragma target 3.0

        sampler2D _NormalMap;
        float4 _MainTint;

        struct Input
        {
            float2 uv_NormalTex;
        };
        

        void surf (Input IN, inout SurfaceOutputStandard o)
        {
            o.Albedo = _MainTint;

            float3 normal = UnpackNormal(tex2D(_NormalMap, IN.uv_NormalTex));

            o.Normal = normal.rgb;
        }
        ENDCG
    }
    FallBack "Diffuse"
}

limber moth
halcyon panther
wicked niche
karmic gulch
#

anyone has an idea why this happens?
this only happens in the build version
normal in editor mode

half ember
karmic gulch
#

checked and no shader error

silk sky
#

Need help on setting up a shader for a 3D progress bar: I basically need to use a float to control the color, 0 to 1, from left to right

#

Should be simple but I can't remember what node to use to handle the X axis 'fill'

#

Should be something like this but right now the result is not working correctly

#

nvm solved, had to use the UV node

late latch
#

Hello!

I want to create a radial gradient effect on object based on screen position.
I want to each object has a "flat" radial gradient.
I thought combining screen position with sphere mask it could work but it looks like a vignette effect :/
It almost that, but I don't want one radial gradient on screen, i want to have one gradient per object but project from screen.

Hope this is clear, thanks!

regal stag
grizzled bolt
late latch
#

I'm checking right now

regal stag
#

Hmm perhaps I misunderstood when you said "flat".
If you want a vignette centered around each object you'll want to use that resulting position I mentioned to offset the original Screen Position.
I've used something like this (though this was before "Screen" appeared in the Transform node so it can probably be simplified)
https://www.cyanilux.com/faq/sg-object-screenspace-uv.png

regal stag
late latch
#

yeah the result would be like this

#

by flat i meant, a gradient project from the camera

regal stag
#

Fresnel Effect should also give something very close to this, as it's based on normals and these are spherical

late latch
#

That's the point I used fresnel before but it only works with sphere not quad or cube

#

So i imagine to project a gradient from the camera on object

#

that's why I said flat

#

Basically like fresnel yes but not depending on geometry

#

maybe there is a better way to do that

regal stag
#

I see, "flat" makes me think more of a single colour. "project" makes sense though.
But yeah, look into the screenspaceUV graph I posted above

late latch
#

Thanks for helping I try this!

regal stag
late latch
regal stag
late latch
#

mmm... does exist a solution to make this kind of effect?

#

like inner smooth outline

#

Because I tried with projected radial gradient but maybe it's not the best solution

karmic hatch
late latch
#

ok thanks! I keep my first solution so

agile storm
#

how do i connect the texture and normal inputs?

grizzled bolt
agile storm
#

i will use this code to get the lighting to work:

regal stag
agile storm
#

ok, i have a code for blinn-phong ready, how would i connect it all?

hearty obsidian
#

How can I get the local vertex position relative to a TRS matrix rather than the TRS of the object?

agile storm
#

basically my task is: create an unlit shader with texture and normal map inputs

regal stag
agile storm
#

my only options are tangent and object

regal stag
#

use tangent for the sample and Transform node from Tangent to World

agile storm
#

why cant i delete these inputs?

regal stag
regal stag
agile storm
#

worked now thx

#

for the normal map, do i change this to Normal? (in the Transform node)

regal stag
#

Yes

agile storm
#

wtb in sample texture node?

hearty obsidian
smoky widget
#

Hi

#

So i have a compute buffer that has indices, and a compute shader that will distribuite those indices according to distance so that let's say the ones that are from 0 to 10m are on the first part of the array, the ones from 10m to 20m on the second, etc...

#

How can I do that? is there a way to keep track of multiple indices shared between compute shaders kernels so that it adds each indice accordingly?

#

They can be at any place (maybe the ones that are from 0 to 10m are the last indices to be checked)

low lichen
smoky widget
#

exactly

#

but i don't want a compute buffer per bucket

low lichen
#

Is the size of each bucket variable, like 0-10m might have 5 indices, 10-20m might have 20 indices, etc?

smoky widget
#

completly variable. the total will always be the same (always let's say 200 elements) but each bucket could be like, 0 elements from less than 10m and 200 in the 10-20. Or they could be 100 elements on 0-10 and 100 from 10-20

#

The amount of buckets is only known at start, so version of the shader could be packing always only in two buckets, while other ones might need to pack 10 buckets

#

And i need to extract the lenght of each bucket too once the shader finishes

low lichen
#

A simple approach I can think of is to create a buffer that has enough elements so that each bucket could potentially contain all of the elements. So if you have 200 total elements and 5 buckets, the buffer would be 1000 elements long. Then, in the shader, once you've figured out which bucket an element should go into, you use an atomic increment to get the next index for that bucket.

#

For the atomic increment, you would have another buffer of just bucket lengths, and atomically increment those lengths. Then you'll also know the length of each bucket at the end.

#

If you ultimately need a tight buffer with no gaps, you can do that as a separate step, once the sorting is done.

smoky widget
#

Do you think I could do it by a single pass, and when doing the atomic increment to increment the current index of the array and the subsequents?

#

therefore that second buffer would contain the lenght of the total array until that point

low lichen
#

No, you can't know where to put the first element of the second bucket until you know how many elements will go in the first.

#

And if you're doing this in parallel, that's impossible.

smoky widget
#

Aah, I would need to insert the element instead of setting it, which I guess is not a good

low lichen
#

Not good when you have a bunch of threads trying to do that at the same time.

smoky widget
#

True

low lichen
#

That's why you have to allocate enough space for each bucket, so their work doesn't overlap with others.

smoky widget
#

Okay that solution would solve one of my problems, so i guess it's worth giving it a try

low lichen
#

Do you have concerns over the memory usage? Or just the extra processing of the second step? The second step would be very quick, just some copies, since you know the lengths of the buckets.

smoky widget
#

Memory

#

there's two problems that I have that this would solve ideally, memory usage and limit of the amount of bukets. Right now I can only process two bukets because that's how I have it, and i have two compute buffers of full lenght

#

With that, I wouldn't cut on memory, but I would have the ability to have as many buckets as needed

#

I dont' really need it without gaps if it means extra processing and not cutting memory

#

(not cutting memory because all of this would be running every frame, so i would cache all the buffers)

low lichen
# smoky widget Memory

One thing you could do, if memory is more important than processing, is to sort it twice. The first time, you only count the elements that would go in each bucket, with the same atomic increment as before. Then the second time, you know how many elements will go in each bucket, so you can pack them tightly in a buffer with no gaps.

smoky widget
#

Yeah, but then there's the problem that Im doing that every frame, and I would still need the full compute buffer at least once each time, so I wouldn't really save on memory

#

Or you mean on the same step move all the elements around to do like array.insert(index)

low lichen
#

You wouldn't need the Buckets * Total Elements sized buffer like before, just a buffer for the length of each bucket, and the Total Elements sized buffer.

smoky widget
#

Aaaag

low lichen
#

I can write pseudocode to explain this better if you like.

smoky widget
#

You mean first step only counts, and the second one moves

low lichen
#

Yeah

smoky widget
#

Mmmmmm, that might work, and the value of distance should be quick to get i think so it wouldn't cost too much processing power

low lichen
#

If it is expensive to calculate the bucket index, you could also have an additional buffer to store that result from the first step. Then the second step just needs to read that result to know which bucket the index needs to go to. But that's extra memory, and not worth it if it's not too expensive to calculate, like you said.

smoky widget
#

Yeah, no the good thing is that I have an array containing all the positions, and then a second one that contains the arrays pointing to each of the position. So calculating the distance should be as quick as getting the corresponding position with the selected index and positioning it. And the index is already cached

#

So it's viable. I will try the first option and then the second and keep the one I like most

#

let's see

#

Thanks!

low lichen
#

If the number of buckets * the number of elements isn't too crazy, then I would prefer the memory intensive way.

smoky widget
#

It shouldn't be crazy, but in future iterations it could get

#

Because im currenly managing maybe 8000 indices, but i want to reduce draw calls (which is the whole purpose of all that) and later on i might have a bigger compute bfufer of 2million per bucket

#

so im trying to keep memory low first

smoky widget
#

soomething like this?

                InterlockedAdd(_Lengths[targetOffset], 1);
low lichen
smoky widget
#

Perfect thanks

#

Do you know how can I copy a single value of a compute buffer into another compute buffer, without going through the CPU in a command buffer?

#

Previouslt i was doing commandbuffer.CopyCounterValue to get the total lenght, but now i need to get that lenght from the second array that contains all lenghts

#

but i dont want to do get data set data

low lichen
smoky widget
#

uf

#

okay, doesn't sound amazing

low lichen
smoky widget
#

The lenght of each bucket

low lichen
#

So it's not just one value, but a value for each bucket, right?

smoky widget
#

yup

#

but each value goes to a different buffer,

#

Later i gues I can put all of those buffers also together, and run only once to copy all lenghts quicly

low lichen
smoky widget
#

yup

low lichen
# smoky widget yup

I think it's a good idea to put all the arguments into one combined buffer. The API is designed with that in mind, with the argsOffset parameter.

#

Actually, you could also just IncrementAdd directly into the combined arguments buffer and avoid the copy altogether.

#

The lengths won't be next to each other in the buffer, but that's a trivial change to support that.

smoky widget
#

true, but the problem is that some meshes have submeshes, and it can be a slight mess, but yes

#

I just want to get step by step changes

#

But you are right, i think I can put all that together and avoid that extra compute buffer

tame spruce
#

hey I'm not sure if this is the right channel for this, but how can you get lines rendered via GL in a camera's OnPostRender() to show up in render textures? I can see the lines if the camera renders to screen, but not if it renders to a texture

frigid geode
#

am i just being stupid or can the unity shader graph just not work with hsv. I parse in a hsv colour, split it and now it just functions as rgb. I dont get it

regal stag
#

You'd then likely need a Colorspace Conversion node to convert back to RGB/Linear as that's what the shader output expects

smoky widget
#

Hey @low lichen , I'm trying to add the data as we said but I think I'm doing somethign wrong here.

int specificIndex = _MeshArguments[1];
_Indices[specificIndex] = id.x;
InterlockedAdd(_MeshArguments[1], 1);                
#

Just because I think that, when I get the index to later set it, there might be other kernels getting the same index and then its trouble

#

I was doing it the wrong way, this fixes it

InterlockedAdd(_MeshArguments[1], 1, specificIndex); 
_Indices[specificIndex] = id.x;               
long current
#

hi!
I got a question for the more advanced here
Is a use of color palette worth it?

Is is better to have one material with color texture and scaling uv's to 0 on the pixel i want the color to be set to
Or is it better to just have 100 materials with diffrent colors and settings without any texture since SRP batcher exists

grizzled bolt
long current
#

Because some part of the palette might have emission

#

And when it comes to draw calls it doesn't change anything? So where is the slight performance improvement

grizzled bolt
# long current Why is it more performant? From what I see it introduces extra unused keywords l...

To my best understanding meshes must share the same material to be able to be batched in some way (non-SRP way) to combine them into one draw call
SRP batching doesn't combine draw calls, but rather makes similar draw calls cheaper
So, several draw calls with the exact same material should be cheaper, even if they redundantly use emission as it's very inexpensive
I'm not sure if the cost/gain between those two ways is big enough to even be measurable though

#

Unlikely to make or break your game

long current
#

its a guest 2 game

#

so performance is important

#

even a scene without lights and lowpoly barely holds 60fps

#

my understanding is that SRP bather doesnt care about the palette and would do the same if there was 100 materials

#

all it looks for are device state changes

grizzled bolt
long current
warped warren
#

Out of these shader options, which one has the best performance?

#

Besdies unlit lol

pseudo jetty
#

im trying to learn how to apply a sobel filter and I have some code that I'm reading but I'm not exactly sure what some of this code is doing. Could someone please explain what the hr and vt lines are doing?

            float2 delta = float2(_DeltaX, _DeltaY);
            
            float4 hr = float4(0, 0, 0, 0);
            float4 vt = float4(0, 0, 0, 0);
            
            hr += tex2D(tex, (uv + float2(-1.0, -1.0) * delta)) *  1.0;
            hr += tex2D(tex, (uv + float2( 0.0, -1.0) * delta)) *  0.0;
            hr += tex2D(tex, (uv + float2( 1.0, -1.0) * delta)) * -1.0;
            hr += tex2D(tex, (uv + float2(-1.0,  0.0) * delta)) *  2.0;
            hr += tex2D(tex, (uv + float2( 0.0,  0.0) * delta)) *  0.0;
            hr += tex2D(tex, (uv + float2( 1.0,  0.0) * delta)) * -2.0;
            hr += tex2D(tex, (uv + float2(-1.0,  1.0) * delta)) *  1.0;
            hr += tex2D(tex, (uv + float2( 0.0,  1.0) * delta)) *  0.0;
            hr += tex2D(tex, (uv + float2( 1.0,  1.0) * delta)) * -1.0;
            
            vt += tex2D(tex, (uv + float2(-1.0, -1.0) * delta)) *  1.0;
            vt += tex2D(tex, (uv + float2( 0.0, -1.0) * delta)) *  2.0;
            vt += tex2D(tex, (uv + float2( 1.0, -1.0) * delta)) *  1.0;
            vt += tex2D(tex, (uv + float2(-1.0,  0.0) * delta)) *  0.0;
            vt += tex2D(tex, (uv + float2( 0.0,  0.0) * delta)) *  0.0;
            vt += tex2D(tex, (uv + float2( 1.0,  0.0) * delta)) *  0.0;
            vt += tex2D(tex, (uv + float2(-1.0,  1.0) * delta)) * -1.0;
            vt += tex2D(tex, (uv + float2( 0.0,  1.0) * delta)) * -2.0;
            vt += tex2D(tex, (uv + float2( 1.0,  1.0) * delta)) * -1.0;
            
            return sqrt(hr * hr + vt * vt);
        }```
regal stag
pseudo jetty
heady horizon
#

Hi, I'm attempting to generate a procedural mesh using compute shaders.. I'm wondering if there's a way to chain two compute shaders, where the data one shader generates is immediately passed into another shader, as I've roughly in the image

Additionally, I'm wondering if there's a way to instantiate a mesh using data generated by a compute shader without having to pass it back to the CPU first

Note that I'd also like to read back block data generated by the first compute shader to the CPU

Thank you in advance

hollow wolf
#

is there a way to create transparent and opaque in one material?

kind juniper
#

As for using the mesh data directly on the GPU, it's a bit complex but not impossible I think. Might need to look at the available mesh API.

grizzled bolt
# hollow wolf is there a way to create transparent and opaque in one material?

No, opaques and transparency must fundamentally be rendered in different stages
There's opaque with alpha clipping for an one bit alpha kind of transparency
Alpha clipping is sometimes used with dithering and TAA to animate and temporally smooth it for an appearance of semitransparency
There's various ways to mitigate sorting problems that arise from transparency like zwrite, an empty pass and controlling polygon winding order, and you could simply use two different materials where needed
There's also at least one third party order independent transparency implementation

kind swallow
#

I am looking into verifying my shaders in a build/test step that they are "SRP Batching" compatible, to catch any accidental breakage. Anyone done anything similar, or have any tips to get access to that information from code? It is currently shown in editor if you select a Shader

hollow wolf
grizzled bolt
kind swallow
amber marlin
#

I really don't understand it yet. I'm trying to follow a Water Shader tutorial (https://youtu.be/MHdDUqJHJxM?t=380) and at the moment i'm supposed to have water with density. But in my version you can only see if you look from the sides, so I think there is something that I did really wrong πŸ˜…. I'm using URP, can someone help me?

In this video we will show you how to create 3D Stylized Water with Foam Shader Graph in Unity engine.
Download project files (Patrons only): https://www.patreon.com/BinaryLunar

00:00 Intro
01:04 Setting-up the project and the scene
02:35 Creating depth fade sub-graph
04:22 Creating the unlit graph for the stylized water shader graph
05:25 Crea...

β–Ά Play video
#

WaterDepth and StylizedWater graphs:

hollow wolf
grizzled bolt
hollow wolf
#

i see, sorry but can you tell me the reason, and does creating multipass shader instead of multi material could actually decrease the drawcall?

grizzled bolt
polar relic
#

Are mesh data like BoneWeights uploaded to the GPU and if so what's the way to access them in shadergraph?
Or do I have to do something hacky like duplicating them into unused UVchannels/Vertexcolor?

hollow wolf
regal stag
regal stag
#

While cheaper this method is also somewhat based on the camera view. It might be more accurate to use a slightly different technique. e.g. this tutorial is about fog but same sort of idea - https://www.cyanilux.com/tutorials/fog-plane-shader-breakdown/
The second example shown there reconstructs the world positions of the scene and uses the Y axis to simulate the fog/water deepness.

heady horizon
# kind juniper You can keep on reusing the same compute buffers in the second shader. After dis...

First off thank you for the reply.

So, when in C# I define a ComputeBuffer, where exactly is it? On the GPU or CPU?

var blockDataBuffer = new ComputeBuffer(whatever params);
blockDataComputeShader.SetBuffer("_blockDataBuffer", blockDataBuffer);
blockDataComputeShader.Dispatch(whatever params); // CPU -> GPU communication ???

chunkMeshComputeShader.SetBuffer("_populatedBlockDataBuffer", blockDataBuffer);
chunkMeshComputeShader.Dispatch(whatever params); // Second CPU -> GPU communication ???

Does this piece of code have to communicate CPU -> GPU twice for both SetBuffer() functions? Or does SetBuffer() somehow just communicate GPU to GPU ?
If it's the former option then how can I write things so I only have to go CPU -> GPU once?

I've heard of Shader.SetGlobalBuffer(), where I could set a global shader buffer from the C# side of things, communicating CPU -> GPU, then have both my compute shaders use that, but idk if compute shaders are able to access global buffers, or how I would even go about accesing a global buffer in a compute shader

Thanks again

kind juniper
heady horizon
#

Ahh

#

So using SetBuffer() twice is no problem basically

heady horizon
#

Thank you so much man

hushed silo
#

Hi! I have a project in which when built, all shadergraphs are invisible. Long shot but does stone have any ideas?

hushed silo
#

On android android and OpenGL es

hollow wolf
# hushed silo On android android and OpenGL es

i never experience this on mobile device, but in VR the problem was because i use MSAA with opengsl graphic API, maybe you can try to disable the MSAA? or change the graphic API to vulkan for testing purpose

grim thorn
#

Got a tesselation question for you guys:
I want to create a shader that adds geometry through tessellation. This I have managed to do. What I'm realising is that though there is extra geometry, it's not rounding itself out the way I'd want to, it just stays angular. I thought using a displacement map of some sort would help but it seems to keep the angular-ness of the shape and move things out from there. Anyone know how one might get a tesselated shape to smoothe out? (Image for reference)

smoky widget
#

How can I set a constant Buffer in a shader?

#

I have a struct containing diferent variables that will be constant, and I would like to set them in one go to the shader

copper vessel
#

hey guys any1 have any advice on how to make a paper texture with shaders?

vivid ferry
#

is it okay that two objects with same shader act like one of them has different sorting layer than other?

#

both have sorting layer = 0

#

but one of them always renders on top

#

the crest is closer to camera

regal stag
vivid ferry
#

but sorting priority now does nothing

#

ohhh i get it now. I will use ZTest Always for characters on 2d plane, but everything else in background or in front will be with LEqual

manic arch
#

Anybody know how to unwrap a panoramic HDRI in shader graph? This is currently not working.

meager pelican
# manic arch Anybody know how to unwrap a panoramic HDRI in shader graph? This is currently n...

See post #2 here:
https://forum.unity.com/threads/extending-unity-built-in-skybox-panoramic-shader.1127171/
You should be able to translate that to nodes easily enough.
If you want to maintain compatibility with Unity's standards, you'll have to view the current panaoramic skybox shader source (which you can download from the archive) and see what variable names they use. And be aware of this type of thing:
https://docs.unity3d.com/ScriptReference/RenderSettings-skybox.html

chrome minnow
#

hi, does anyone know any resources to learn scan effect in URP and also highlighting enemies when that scan hits them, or if anyone know how to do this mechanic pls can you teach me

proven rapids
#

Hey! I am looking to create shader for the minimap I am using. I want to remove all textures and replace structure outlines with a solid color as well as the background.
Also, Currently using a Render Texture and a camera to display the minimap

Game is
*3D
*Isometric top down

  • I'd like to render the player as an arrow, dot or whatever
  • Id like to render the enemies with FOV cone

Any help or links would be fantastic.

sterile wind
#

Im usning unity 2d urp version 2022.1.23f1 and i cant seem to find full screen shader graphs, can someone help me, are they not in my version and if so what version of unity should i update to to get full screen shaders

sterile wind
#

thank you

tardy dock
#

hi, does anyone know the way to make the line between the sand and the grass less uniform? i still want it to be smooth just that the grass would come down further and not perfectly aligned.

echo berry
#

if I uniformly lerp (Violet Indigo Blue Green Yellow Orange Red) does that give me a uniform progression through the colors? Are there different key frame colors I should use for a better rainbow gradient animation?

halcyon panther
eager folio
grizzled bolt
# echo berry if I uniformly lerp (Violet Indigo Blue Green Yellow Orange Red) does that give ...

"Uniform" is very subjective when it comes to color interpolation
https://www.alanzucconi.com/2016/01/06/colour-interpolation/
If what you get by lerping is good enough for you then it's good enough
You could also sample a gradient (or a texture that stores a gradient) to have very fine control over the rainbow, but using some fancier math like explained in the article is also a possibility though rarely worth the trouble

willow forum
#

hi guys i use these lines in my shader to go through the different frame of a sprite sheet

//calculate t to have a constant animation speed
float t = ((_Time.y * animationRatio) ) % 1;
uint index = _Animation_Frame_Start + (t * animationLength);

but with this when i change wich row of the spritesheet to use the animations does not start at the first frame everytime (since _Time.y) can be anything at this point.
How can i change this so that t will be 0 when i change the "AnimationID" ?

novel depot
#

for damage indicators would you guys suggest shaders or UI

frigid jay
willow forum
#

also does this works in hlsl?

timeOffset = (_Time.y % 1) * (oldAnim != _AnimID)
regal stag
# willow forum something like that ?

Shaders don't really store variables between frames, so setting "oldAnim" isn't going to work here.
You could pass in that timeOffset as a property from C# but it may be better to just move this whole calculation to C# and pass in the frame index instead.

willow forum
#

ok i see thanks

low lichen
#

@regal stag Hey, I was considering using your URP Lit shader code template, but it doesn't appear to support Forward+. I'm ready to spend the time to work it out myself, but just wondering if you've already looked into it?

regal stag
low lichen
low lichen
smoky widget
#

Any idea why this doesn't work if the number of iterations is low? And is there a way to do it diferently?

#

_MinMaxBuffer[0] = min(_MinMaxBuffer[0], data.position.y);
_MinMaxBuffer[1] = max(_MinMaxBuffer[1], data.position.y);

#

I just want to extract the minvalue and maxvalue after certain amount of iterations

#

My only idea rn is that they are all writing it at the same time and therefore only the last value is actually stored, how can I calculate the min and max in a nice way?

#

solution

            InterlockedMin(_MinMaxBuffer[0], floor(data.position.y));
            InterlockedMax(_MinMaxBuffer[1], ceil(data.position.y));
molten crown
#

How do I change the material for an image

mental bone
molten crown
#

Yes

mental bone
#

That is how you change it

molten crown
#

You mean like this?

#

Because I still do not get a preview :(

regal stag
molten crown
#

Ohhhh yes it has a preview for "Unlit", thank you!

willow forum
#

hello i cant seem to find how i can use the alpha channel of my texture to make it transparent, how do i do that ?

regal stag
willow forum
regal stag
#

vert/frag or surface shader?

willow forum
#

ho no i dont remember i use it for billboard

molten crown
#

I don't understand this, why does it look like this in the preview, but black on the UI image?

willow forum
regal stag
regal stag
heady horizon
#

Will this compute shader cause a race error?

#

I'm trying to figure out how properly to use a counter

tight beacon
#

hi, how to recreate occlusion map in URP Lit shader graph?

hybrid hawk
#

Hi, i am using a custom shader with a script manipulating MaterialPropertyBlock for collor effects, however i found that i need to get the property block and coppy over the main texture every time i want to change a collor in the property block since the texture can change trough a animator


myRenderer.GetPropertyBlock(dummyPropBlock);
propBlock.SetTexture("_MainTex", dummyPropBlock.GetTexture("_MainTex"));

myRenderer.SetPropertyBlock(propBlock);```

is there a better way, besides combining all texture sheets into the same png?
kind juniper
silk sky
#

I need help on changing an exposed parameter of a shader via code, even if I target the right Reference it doesnt change

#

I noticed that the material in the scene, once in play mode it becomes an "instance", could that be the cause?

rare wren
silk sky
#

this is how I try to set the emissive to 0:

pillars[trophiesIndex].GetComponent<MeshRenderer>().sharedMaterials[1].SetFloat("_EmissiveValue)", 0.0f);

#

This is the reference

#

I tried with sharedMaterials but results is the same, the value doesnt change

#

and yet the graph is very simple

rare wren
#

Directly route emissve value into the base color to see more directly if it does anything maybe?
And are you sure this code is running without errors?
You also set the value to 0, which basically means the emission is black, doing nothing to the graphics

silk sky
rare wren
#

I again recommend to just pass the value to base color to directly see any change

#

To see where the issue might be
Maybe emission is just broken in some way and the value passes on normally

silk sky
#

it is still visible even as it is, I've checked it by manually changing the value from the inspector

rare wren
#

Is it the 2nd material on the object?

#

sharedMaterials[1] means the 2nd object
If it has one object, just use sharedMaterial (without brackets(

silk sky
#

I've tried just with color by detaching the emissive to the master and still doenst work

rare wren
#

Start basic, start with an object with just 1 material in an empty scene with just that script

heady horizon
silk sky
rare wren
#

Then there is something going wrong on the code side.
Split up everything and debug everything to see where it goes wrong

silk sky
#

the code is in start

#

and if I debug log the material at the same address I execute the code to change float it returns the right name

#

cube.GetComponent<MeshRenderer>().sharedMaterial.SetFloat("_EmissiveValue)", 0.0f);

rare wren
#

I think there is a ) too much

silk sky
#

fun thing is that I've even copy pasted the reference

polar relic
#

How to read an exact (X,Y) pixel in HLSL?
I know tex2D(texture, uv) exist, but is there a variant with clean integer coords instead of having to do it via float&UVs and take the risk that filtering muddy the values due to imprecisions?

winter ridge
#

Hello, I am currently developing an application for the Quest 3 using AR. now I want to use ObiFluid to render fluids but this cannot be transparent because it uses refraction and the Quest 3 does not give access to the camera. I asked the ObiFluid developer and he said the shader and ObiFluidRenderer should be done with basic alpha blending instead of refraction but this needed some changes. Anyone has time and would be willing to help someone in need out?

low lichen
#

Doesn't have to be float4, just however many channels you need to read.

polar relic
#

Thanks!

quick scaffold
#

idk nothing about shaders and want to learn it by programming, any sugestions of when should i learn?

plush oasis
#

any shadergraph pros here who can shortly help me?

cursive spade
#

Hey everyone, is it possible to read / write to the stencil buffer using a custom shader graph node in HDRP?

frigid jay
# cursive spade Hey everyone, is it possible to read / write to the stencil buffer using a custo...

It is possible in d3d11 in general. For writing D3D 11.3 introduces "Shader Specified Stencil Reference Value" via SV_StencilRef shader output semantic. I believe this can be used in unity shaders without problems. But for reads special crafted shader resource view (SRV) to the depth-stencil texture is needed. It is hardly multiplatform-universal, so the only way is to make native plugin and make required resources directly there. I beleive there is similar approach in Vulkan and modern OpenGL.

quick scaffold
#

my vs isn't recognizing the .shader, is there anything i should do?

chilly robin
#

Working on a fullscreen shader. How can I make sure this is always circular no matter the screen's aspect ratio or resolution?

kind juniper
kind juniper
kind juniper
#

Or just use screen space instead of uvsπŸ€·β€β™‚οΈ

kind juniper
# chilly robin Something like this?

Actually, might need to reverse that(either height/width or divide instead of multiply)πŸ€” test it out and see for yourself.

Also, not sure about that tiling and offset node. Do you really need it?

chilly robin
#

I think so? The problem I'm having now is keeping it centered.

#

The screen division (width/height) actually seems correct

#

But yeah, now I need to figure out how to work out keeping it centered on different resolutions.

kind juniper
#

Since the uvs would be 0 to 1 where bottom left(unless I'm misremembering it) is 0 0 and top right is 1 1

chilly robin
#

Nah, that's still off center when I change resolutions

kind juniper
#

The resolution shouldn't really matter if you're manipulating the uvs.πŸ€”

chilly robin
#

I should say aspect ratio instead of resolution

#

Adding to the vector, I can get it centered on 16:9 ratio for example. But then it's off by a bit on 16:10 or 4:3

humble tide
#

is there any way to get the shadow and light atten from baked lighting?

cursive spade
deep whale
#

Hey everyone, hope all is well! How would I set the edges of the cube to a physical property so the light emitting from the center would cast those shadows?

grizzled bolt
deep whale
quick scaffold
deep whale
#

The mode is greyscale

grizzled bolt
deep whale
#

@grizzled bolt Sorry should of clarified, its my actual player. Needs to be point i think?

#

Im going for the same effect a flame lantern has

#

so my cubemap would look like this when its done? black boarders and white middle

grizzled bolt
deep whale
#

cool

#

ty

grizzled bolt
# deep whale Legend ty

UnityChanThumbsUp you can also blur the cookie texture a bit to make it more lanternlike, or whichever way you prefer

deep whale
#

Yeh ill go in and do the graidents, just had no idea how to do the core

#

Thank you thank you

deep whale
ornate crypt
#

Hey, I got a hexagon grid. I wanna add a shader to it which does a little form like the screen, but only on the top of my hexagon. For instance, I got what u see in the first screen for nodes and output, and that's pretty not much as expected

ornate crypt
#

I'm expecting a line with a certain thickness on the top of the hexagon

#

at the border

#

(i'm not a good drawer xDDD)

#

but a thing like this

grizzled bolt
#

It's better to use an image texture or UV coordinates to determine the "top" and the "outline" areas of your mesh so the shader can utilize them

ornate crypt
#

I got a texture, i'm going to try on that yeah

grizzled bolt
#

Otherwise it just sees polygons with no knowledge about how they're meant to be different

ornate crypt
#

u right yeah

pale python
#

hi ,
im trying to understand how to use stencil
when we say something like

  Ref 1 Comp 3 Pass 0

can we do something conditional statement in the pass section ?
like if(ref == 1 ) Pass 0 else Pass 6
this is just an example

#

i feel like it would be more convenite if we do that.

low lichen
steel token
#

Hi, I'm new to Unity and I want to achieve a sort of "ghost effect". I'm using Unity URP with deferred rendering. The specific effect I'm trying to achieve involves having an enemy ghost be rendered onto the scene with the "additive" or "linear dodge" blend mode. I know materiels can be set to translucent > additive but this causes meshes to have weird clipping. I want to in a way, have the final image be as if it was rendered as a solid then displayed as additive. I don't know if I should be looking into custom shaders or if there's an easier way to achieve this.

#

my failed attempt (mouth and nose clipping):

#

example of the effect i'm trying to achieve:

terse epoch
#

Anyone know of any simple animated shader scripts (or where I could find some) that would allow me to overlay a pattern on a texture model? I want to have simple white dots flow continuously over this model. Is this possible?

shrewd elm
# steel token Hi, I'm new to Unity and I want to achieve a sort of "ghost effect". I'm using U...

I would try creating a custom shader in Shader Graph with a Fresnel effect. An excellent tutorial on how to create a ghost shader like the one in Luigi's Mansion: https://www.youtube.com/watch?v=KFMOD9jLCUg

Let's create some Ghosts from scratch! We go from Blender to Unity Shader Graph and create some Luigi's Mansion 3 inspired ghosts. The Ghost Shader uses Fresnel and another technique to add glow inside them. Enjoy!

Shader Graph - Vertex Animation: https://youtu.be/VQxubpLxEqU

Check out this game I'm working in: https://store.steampowered.com/a...

β–Ά Play video
meager pelican
# steel token Hi, I'm new to Unity and I want to achieve a sort of "ghost effect". I'm using U...

Hmmm....
OK, so option A is to draw it as an opaque but blend it with the background like it's a transparent. The trick with that is that the background has to be there first, so you'd draw this ghost LAST, after the skybox even. The other thing is that you MIGHT need to know how to get the background pixel color if you're blending manually (aka with custom math). So try doing a blended draw in a high queue number and see if that works for you. Probably after the skybox, which is drawn in queue 1000
https://docs.unity3d.com/Manual/built-in-rendering-order.html
This will give you "issues" though if you have multiple ghosts and they overlap, since the draw order for opaque is front to back.

There's other ways, Optoin B's, like drawing it transparent queue, particularly if you want proper blending of transparents which are drawn back to front, so multiple ghosts could overlap but as you noted can "cause meshes to have weird clipping".... Make sure you do a z test and write to z. Also you might need 2-pass shaders to draw front and back faces of a mesh, clipping back where front is already drawn, or draw front facing polygons only, or whatever.

meager pelican
#

This stuff is harder than it first appears.

silk sky
#

any tips on making good looking metallic materials? I want to make Bronze, Silver and Gold shaders

copper edge
#

Hey, i am unable to render a material on top of others. I have tried changing the render queue by script.. but it doesnt work.


    // Start is called before the first frame update
    void Start()
    {
        Renderer renderer = GetComponent<Renderer>();
        renderer.material.renderQueue = _renderqueue;
    }```

P.s: i entered the debug mode in the inspector and i can see that the material render queue is changed to 4000. However it doesnt work
pale python
low lichen
#

It would help if you describe what you want to do at a higher level. Maybe this is not the right approach.

pale python
crude river
#

Reposting this as I'm thinking this is a shader issue over terrain. My waterplane has a white outline when the alpha is turned down

low lichen
low lichen
hollow raft
#

Hey atm I am trying to find a way to disable a sun texture in shader using c#. The reason for this is I am using two directional lights and when It is night time I see the sun even though it is now dark. I tried to set it up so that the sun goes away but the sun is still there. Anyone know why? This is parts that I am using to turn off the sun. ```{
[Header("skybox")]

public Renderer rend;


public float sunAmount; //goes from 0 to 1 to enable or disable the sun```  ```//rend.material.SetFloat("_SUN", sunAmount = 1); //enables the sun  //rend.material.SetFloat("_SUN", sunAmount = 0); //disables the sun
Property name: _SUN
Type: Float
Description: A toggle to enable or disable the sun feature. If enabled, a sun will be rendered in the sky.
crude river
pale python
low lichen
low lichen
low lichen
crude river
#

Same texture

pale python
low lichen
low lichen
#

Then you just need a double sided mesh.

smoky widget
#

How can I use a keyword in a compute shader?

pale python
smoky widget
#

I keep getting invalid kernel

regal stag
smoky widget
#
// Each #kernel tells which function to compile; you can have many kernels
#pragma multi_compile_local GET_COLLIDERS
#pragma kernel SelectIndices

#if GET_COLLIDERS
AppendStructuredBuffer<float3> Instance_Positions;
#endif

[numthreads(8,8,1)]
void SelectIndices(uint3 id: SV_DISPATCHTHREADID){
  ///code
    #if GET_COLLIDERS
    Instance_Positions.Append(data.xyz);
    #endif
}

This is my current attempt

regal stag
smoky widget
#

it does!

#

Thanks!

regal stag
# crude river It's just a blue plane with low alpha

The darker part is probably the shadow cast by the plane then, and the edge caused by shadow bias settings.
Should be able to disable shadow casting on the MeshRenderer, or maybe material if it exposes that.

hollow raft
#

my first thought was to setup a connection between the two scripts

#
    public CuteSkyboxEditor CuteSkyboxEditorComp;```
#

and have it change it via CuteSkyboxEditorComp.SomethingClass(...) but I don't think that would work

#

Any suggestions?

regal stag
#

Editor scripts won't exist in builds afaik so that won't work

hollow raft
#

dang

regal stag
#

If you check the shader file, it might have a multi_compile or shader_feature line, that will tell you the keyword that needs to be toggled.

#

Ideally it should be multi_compile, as shader_feature will also strip the shader variants from the build that are unused.

regal stag
#

If the skybox is a graph instead, check the Blackboard for the keywords

hollow raft
#

it has something of that nature with // Pragmas #pragma target 3.0 #pragma multi_compile_instancing #pragma multi_compile_fog #pragma multi_compile_fwdbase #pragma vertex vert #pragma fragment frag

regal stag
#

That's pretty standard stuff. If there isn't any others maybe it's not using a keyword to toggle the sun 🀷

hollow raft
#

like this? // Keywords // PassKeywords: <None> #pragma shader_feature_local _CLOUDSTATE_ONELAYER _CLOUDSTATE_TWOLAYER _CLOUDSTATE_DISABLE #pragma shader_feature_local _ _SUN #pragma shader_feature_local _ _MOON #pragma shader_feature_local _ _STARS #pragma shader_feature_local _ _CUBEMAP #pragma shader_feature_local _ _STARROTATION

regal stag
hollow raft
#

Do I need to call the skybox material or is it just material.EnableKeyword? I have done this already [SerializeField] private Material skyBoxMaterial;

regal stag
#

On the skyBoxMaterial yes

hollow raft
#

thanks!

pale python
#

is it possible to manage draw calls on the same object via shader in URP ?

pale python
hollow raft
# regal stag Ah there we go. So yeah, the keyword is just `_SUN`. Should be able to toggle it...

referring to "multi_compile_local" does this cover that issue? ``` // Pragmas
#pragma target 3.0
#pragma multi_compile_instancing
#pragma multi_compile_fog
#pragma multi_compile_fwdbase
#pragma vertex vert
#pragma fragment frag

    // Keywords
    // PassKeywords: <None>
    #pragma shader_feature_local _CLOUDSTATE_ONELAYER _CLOUDSTATE_TWOLAYER _CLOUDSTATE_DISABLE
    #pragma shader_feature_local _ _SUN
    #pragma shader_feature_local _ _MOON
    #pragma shader_feature_local _ _STARS
    #pragma shader_feature_local _ _CUBEMAP
    #pragma shader_feature_local _ _STARROTATION```
pale python
#

im trying to stop renderer from rendering some pixels using stencil and force it to override them with a different material ( lets say red )

regal stag
hollow raft
#

ah ok

pale python
#

there is a way of using 2 instances of the same object ( 1 that shows everything except those pixels and the other show nothing but those pixels )but i was wondering if there is any better way

#

i learned that in URP i can only use 1 pass , so it's quite limited

regal stag
regal stag
hollow raft
# regal stag No, I mean using `#pragma multi_compile_local _ _SUN`

I set this up earlier and I was wondering which one I should use? I saw online different answers and so I wanted to ask you since you seem to know what you're doing. rend = GetComponent<Renderer>(); rend.material.shader = Shader.Find("CuteSkyBox"); or ```

    RenderSettings.skybox = skyBoxMaterial;```
regal stag
pale python
# regal stag Not really. Drawing twice testing against the stencil value is the standard way ...

thank you for replying but yes as you have mentioned there are many ways
so clearly I need to render it twice, there is no way to do it in the same shader correct ?

then what is the best option ?
1 - making 2 instances of the same object with each object has it's own material
2 - make 1 instance of the same object but with 2 materials
3 - something else ( i was hoping that i could use the same shader like with a conditional statement or something, but whichever is the most optimized would be best)

regal stag
# pale python thank you for replying but yes as you have mentioned there are many ways so cle...

In the Built-in RP you could use multiple shader passes. URP doesn't allow this and even if it did, it would prevent batching so could end up being more expensive than the other options here.

Option 2 works if the mesh doesn't have more than one submesh as with extra materials it loops through the submeshes again. I've defnitely used this myself, but have heard you shouldn't rely on this behaviour.
Option 1 is probably safer. Maybe not ideal to have duplicate GameObjects and you need to keep the objects synced (easiest to parent one to the other) - but it works.

If there's many objects that need this second pass, using a RenderObjects feature is more convenient as you can just specify a whole Layer, as well as can use Stencil overrides rather than editing shader code or properties. Using a layer is a bit annoying if there's just a few objects though, then Option 1 is easier.

pale python
queen vortex
#

Why is my NdotL looking weird like this?

#

Here is the code

regal stag
queen vortex
#

I totally forgot about NORMAL semantics

fleet olive
#

im trying to create my own metaballs in shadergraph and ive hit a bit of a roadblock

#

kinda the biggest part of metaballs, actually

#

getting the distance of the nearest ball to calculate the proper color

#

or maybe thats not the way to go about it

#

im not really sure

#

^ for a 2d game

#

i feel like i might have to do some programming part of this, i dont think you can do it all in shadergraph

regal stag
# fleet olive getting the distance of the nearest ball to calculate the proper color

The simplest method I'm familiar with is rendering particles (w/ gradient - like the default particle texture) to a Render Texture, then step in the shader or apply a colour ramp, whatever. Avoids needing to do distance calculations as that could probably get expensive with many balls to check against.

But not sure if this kind of technique could support balls of different colours. If that's important, may be best to search online for a metaballs technique that works for your use case and try to replicate it.

fleet olive
#

the game is basically where you control water with a gyro

#

if you dont clump your water together, it warns you itll evaporate by flashing white

#

which could be a problem

white shell
#

Anyone know much on doing shaders for mixed reality (quest3) cause as far as i can tell, for a shader to work on the quest, it needs to use a specific shader

burnt crown
#

Anyone know how i can disable both of these in a lit shader graph? got me stumped.

solar plaza
#

hey, anyone know how to sample the depth of the main light shadow map in hlsl?

crude river
#

If I have a glass sphere that refracts view vector, can I easily replace the view vector of that from another camera?

#

*correction, I am getting the colours from scene colour node. If I could change this to another camera, that would work

heady horizon
#

Hi, I was wondering if explicitly declaring each of these as variables would have an impact on performance vs if I just calculated them inline

Currently doing this for readability, would prefer to keep it

meager pelican
# heady horizon Hi, I was wondering if explicitly declaring each of these as variables would hav...

I'm guessing the shader compiler with "hoist" the common expressions out (faceIndex * 16 and faceIndex * 24) and use a temp during the variable assignments, or just use the 1st one in each of your blocks. Can't prove it though without testing, perhaps check the generated IL code and see if you can get a hint at it even if you don't read it fully. But comparing that to another set of expressions "inline" is impossible without examples, and even then, you're better off benchmarking.

heady horizon
#

Thank you!

normal falcon
#

Hello, maybe somebody can point me in the right direction? I have a shader that scrolls glowing "wave" lines across a character. The scrolling bit of the shader is in the image. I move lines by using a texture that defines the gradient along which lines can move (since it's a complex pattern that needs to follow the character geometry), and move them by multiplying gradient with time value, wrapping it around with fraction. So each pixel of the texture rises from 0 to 1 indefinitely. I then use that as a mask for the glow lines.

The problem is that when the LinesSpeed float is constant - everything works peachy. But when I start to increasing it through code via simple lerp from calm value to agitated value, the lines start to increase their movement speed way to quickly, ending in strobing mess, until the lerp is finished and then they snap to the speed I actually intended them to move. So for instance if I want to increase speed from 1 to 4, while lerp is in process everything looks more or less like I want if I try to increase speed from 1 to 1.07 or something like that instead (but after lerp is done, lines become slow again). What causes this and what can be done about that?

heady horizon
#

Hi, I've been trying to figure out a solution to this problem which avoids CPU data readback:

I'm procedurally generating a mesh on the GPU of unknown vertex and index count, which varies between some known minimum and maximum
It's fairly easy to use a compute shader to pre-calculate the number of vertices and indices a given proceudral mesh will require, but I'm having a difficult ime figuring out how to the the meshes vertex and index buffers to the lengths calculated by the compute shader WITHOUT using GetData(), which reads the results of the compute shader back to the cpu

I'm using Mesh.SetVertex/IndexBufferParams(count, layout) currently, and I'm hoping there's some way I can pass a reference to the result of the vertex/index count calculator (which exists on the GPU)

Would really like to avoid the extra latency caused by GetData

copper edge
#

Hey, how can i create a simple basic shader for texts in shadergraph?

regal stag
novel depot
#

Is there a name for a shader that simply projects either a colour or pattern onto the floor which also warps over stairs. I need a shader that creates somewhat of a ring aura beneath the player and must warp with its surrounding terrain

meager pelican
# heady horizon Hi, I've been trying to figure out a solution to this problem which avoids CPU d...

You can't pass a reference, exactly, since GPU code doesn't use them. BUT, you can perhaps use an append/consume structure. So as you build your mesh, you APPEND the verts to it. And then later you can CONSUME the data in the buffer. But IDK your exact use case. Here:
https://docs.unity3d.com/ScriptReference/ComputeBufferType.Append.html
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-object-appendstructuredbuffer-getdimensions
https://docs.unity3d.com/ScriptReference/ComputeBuffer.CopyCount.html
I'm unclear if you actually NEED all the mesh data on the CPU, or just the counts. Because if you need the actual vert data the only way I know of getting out of the GPU is with getdata().
If it's just the counts, the getdata call shouldn't be too bad. IDK how else to do it other than to pass an arbitrary max to invoke a procedural shader and have the instances bail out early if they've exceeded that max. They would know the size from the getdimensions call I think.

Gets the resource dimensions. | AppendStructuredBuffer::GetDimensions function

hollow wolf
novel depot
#

way simpler

hollow wolf
#

yup, and if you on unity 2022 then you can use layer to ignore the player instead of render feature

novel depot
#

yess, one of those overthinking moments again

#

ty for that shout

hollow wolf
#

np man Thumbglass

low lichen
normal falcon
crude river
#

If I want to have 3 different cube colours of the same material using the input nodes in a shader graph, I want to use a preset. Changing the preset of one cube changes them all for some reason. Is there a way to change each one individually without duplicating the material?

normal falcon
crude river
#

So just duplicate the material over using different presets?

#

I could but didn't think it would be efficient

vague imp
#

I haven't seen anything with that icon before

crude river
#

Shader presets

toxic fable
#

how do I edit a prefab's material?
I'd like to change Rendering Mode of Screen Surface to Transparent

hollow wolf
stuck flame
#

just thinking if its possible to make like gradient color tile along this white light with shadergraph

#

cant really find any examples when uv is not like in straight line and its not just plane

#

I think just properly uv mapped and using UV in shadergraph should work?

novel depot
#

Anyone know how I can disable a decal from rendering on the player

grizzled bolt
compact reef
#

Hi , I was trying to implement dither crossfade on mobile vertex lit shader got an error ,

#

that's how im trying to apply

#

and these errors showed up

civic lantern
compact reef
civic lantern
#

However there is uv0 which you can use

compact reef
#

so , i'd put uv0 here?

compact reef
civic lantern
#

Yes

civic lantern
#

@compact reef I don't accept DM's for private help, it's also against the server rules

compact reef
#

im sorry

civic lantern
#

Ask your questions here and if someone knows how to help, they will

sharp bloom
#

How to hide terrain grass, e.g. under a bonfire?

smoky widget
#

What technique can I apply to shadows of objects to reduce the amount of times they are being rendered, but still appearing when needed?

#

I was applying frustrum and occlusion culling to the original, but with shadows they sometimes disappear when they shouldn't

agile storm
#

~~i have an issue with my shader code:
redefinition of '_Time' UnityShaderVariables.cginc:40

is it because of my code or some setting in unity? ( i havent touched time, only assigned it to a variable)~~
edit: it was because of an #include

low lichen
smoky widget
#

I can just render all shadows, but maybe there's some math/article that I can apply to save resources?

low lichen
# smoky widget I can just render all shadows, but maybe there's some math/article that I can ap...

I don't think there's any simple way to determine whether a shadow of something will be visible on the main camera. The most optimal approach for minimizing draw calls/instances would be to perform culling separately for the main camera and the shadow camera. Otherwise, you are sharing the same culling parameters for both, so the shadow camera will render things it can't see and the main camera will render things only the shadow camera sees.

#

But that comes at the cost of performing culling twice or more.

smoky widget
#

I was already doing it actually twice (because command buffers and im rendering directly to the shadow pass), how can I get the shadow camera?

low lichen
#

In which rendering pipeline?

smoky widget
#

built in

low lichen
#

The command buffer would then contain the DrawMeshInstanced or whatever to draw it during the shadow map pass.

smoky widget
#

yeah, im already doing that

#

But the camera info is the same, there's no special shadow camera (or at least im not using it)

low lichen
smoky widget
#

I set it before hand to the compute shader

#

one sec

low lichen
#

Just the properties on the main Camera?

smoky widget
#
            Matrix4x4 P = cam.projectionMatrix;
            Matrix4x4 V = cam.worldToCameraMatrix;
            Matrix4x4 VP = GL.GetGPUProjectionMatrix(P,false) * V;
            commandBuffer.SetComputeMatrixParam(DistributeAndOcclude, matrixID, VP);
``` The viewpoint matrix
#

and the position

            commandBuffer.SetComputeVectorParam(DistributeAndOcclude, cameraPositionID, cam.transform.position);
low lichen
#

Do you only need spotlight support or are you also using point light shadows?

#

And directional light (is similar to spotlight)

smoky widget
#

For now only directional light

low lichen
# smoky widget For now only directional light

The way Unity calculates the shadow projection and view matrices for directional lights does not appear to be exposed, so I don't see an easy way to access that on the CPU without recreating whatever logic they are using. Directional light shadows follow the main camera, but I don't know in what way.

But since you're performing the culling on the GPU, you should be able to access the VP matrix directly from the global shader properties, which should be set to the shadow matrix during the shadow map rendering event.

#

These properties should be set to the shadow matrices Unity calculated for the current light if you dispatch your compute shader inside that event in the CommandBuffer.

smoky widget
#

They don't seem to be directly interchangable

#

I was doing this with mine

        float4 viewspace = mul(MATRIX_VP, position); //Get the viewspace matrix
#

But using UNITY_MATRIX_VP instead of Matrix_vp directly doesn't give me the same results

low lichen
smoky widget
#

Yup

low lichen
#

These matrices have nothing to do with the main camera, other than for directional lights, where it will be offset to follow the position of the main camera.

#

You don't want the shadow camera culling to be based on what the main camera sees, since you can still see the shadows of objects that are off screen.

#

And like I said, I don't think there's any trivial way to know whether an object in view of the shadow camera will have visible shadows on the main camera, to cull out those that won't be visible.

smoky widget
#

So I don't follow, what exactly are those matrices, and how can I use them in my scenario?

low lichen
# smoky widget So I don't follow, what exactly are those matrices, and how can I use them in my...

The simplest case to think of is the spot light. When it renders the shadow map, it's like there's a temporary camera placed where the light is and pointed towards where the spot light is pointed, with its FOV based on the angle of the spotlight. It renders the scene from that point of view, but only using shadow caster passes, which just return depth. The result is the shadow map, which is a sort of depth map, which can later be used to determine whether a pixel on the main camera is "visible" to the light or not.

#

What the light "sees" is independent of what the main camera sees. You want culling to be based on what the light sees, which you can calculate by using these matrices, which are the matrices of the temporary camera placed where the light is.

smoky widget
#

Aah I see

low lichen
#

In the case of a directional light, it's an orthographic camera placed somewhere above the main camera, following it around.

smoky widget
#

should I use the Unity_Matrix_MVP or Unity_matrix_vp?

#

Ah, but non are frustrum culled now when using UNITY_MATRIX_VP

low lichen
low lichen
smoky widget
#
float4 viewspace = mul(UNITY_MATRIX_VP, position); //Get the viewspace matrix
float3 clipspace = viewspace.xyz; //Save the w value

clipspace /= viewspace.w;

clipspace.xy = clipspace.xy * .5f + 0.5f;
clipspace.z = viewspace.w;
//Scale it accordingly

bool inView = clipspace.x < -0.2f || clipspace.x > 1.2f || clipspace.z < -0.1f ? 0 : 1; //Initial quick elimination from frustrum culling
low lichen
low lichen
smoky widget
#

Yup, in general they are small enough (blades of grass in some instances)

#

and in others they are trees, but I have a distance treshold where only after you get enough distance to them (when they can be considered points) I apply frustrum culling, with the extra check of .2f on horizontal and vertical plane I've haven't found yet popping

#

(the distance is double the size of the max diagonal of the bounds of the object)

low lichen
#

How are you visualizing what gets culled in the shadow camera? How do you know nothing is getting culled?

smoky widget
#

When using the matrix of unity

low lichen
#

So you've also made this change for how the main camera culling is calculated and seeing that nothing is getting culled on the main camera?

#

Or do you mean just based on the shadows that are visible?

#

If the right image shows what the main camera sees, then I wouldn't be surprised if the directional light shadow map covers the whole map, since most of the map is visible to the main camera.

smoky widget
#

When using my matrix

smoky widget
#

ACTUALLy

low lichen
#

It's a bit hard to tell, is it just the shadows that not correctly culling, or also the models themselves?

smoky widget
#

Since the models are ina completely diferent pass and command buffer, none of the changes should be affecting it. THe models use the camera matrix

#

So, shadows, left is the scene view (that renders all the shadows that are actually being rendered, and right is the game view, that actually shows what's up

#

Okay, forget the three pictures and videos I just sent

#

They where colliding with some occlusion I had working and was giving bad results

#

So, Shadows using the camera matrix

#

Shadows using Unity_Matrix_VP

low lichen
smoky widget
#

yeah, it captures the whole terrain

#

(im not using cascades, because they dont work for some reason yet)

low lichen
#

You can override the shadow matrix of the light if you think you can calculate a better one, based on what you know about the scene.

#

Or hmm, they say it's just the projection matrix, so you might not be able to position it differently. This is probably mostly for spotlights, where the position is just based on the transform.

#

But then again, if you go full custom matrix, then you can just pass it in your own property.

smoky widget
#

Mmm, I don't think I know enough math to calculate a btter

#

Okay, i guess I will just make it so that It acts the same way as usually but buffed bounds

compact reef
#

what should I do now

smoky widget
#

Do i need a draw mesh for each cascade?

#

actually nvm, it was on the wrong light pass

tranquil wolf
#

I can't find a tutorial for creating a stylized rock graph shader in unity, they are always in blender or unreal. Anyone know of a good reference for this particular thing?

smoky widget