#archived-shaders

1 messages · Page 66 of 1

flat hedge
#

I think that I had > 1 alpha values, used clamp 01 and it solved the issue, thanks

halcyon panther
dusty creek
#

what kinda noise would you use for a procedural texture used to color the grass shader above it? not too familiar with all the kinds of noises

drowsy crest
#

(URP) I have a pretty basic shader setup with some normal information, and for some reason the normals only show up when the shader is applied to a primitive object like cube or sphere, and I'm trying to put it on imported fbxs from blender. ANy idea why this happens?

regal stag
drowsy crest
#

yeah normal map texture (driven by noise in this case). I'm 99% sure they're uv mapped but let me double check

#

yeah they weren't uv mapped lol

#

thanks

lethal bison
#

does anyone know how to design a shader that affects tilemaps depending on a texture?

#

like the alpha of the tilemap changed depending on the black in the texture

jolly kernel
#

How do I make everything that is hit by a light or some sort of raycast be shaded and the rest black / dark

round linden
#

I have a question about color gamut and which screen I should choose. I want to buy a new laptop and I'm wondering about what color gamut I should select. I know that 100% sRGB is the standard, and anything below that will not display colors 'accurately'. For example, a 45% NTSC panel may not accurately represent colors. However, I found a laptop within my budget that offers a 100% DCI-P3 color gamut. Upon researching it on Google, I discovered that it covers much more than 100% sRGB.

From what I understand, converting from a lower to a higher color gamut or vice versa can result in color flaws, such as higher saturation than the original image. I'm unsure if I should buy a laptop with 95-100% sRGB or if I can choose one with a slightly higher or lower color gamut. (I'm aware of hardware color calibrators, but i don't really want to buy one)

uneven geyser
#

Hey hey guys, im wondering if i could grab some help making a blue light shader in URP. I have a bluelight torch item, and i want to make it so that when i shine the torch over a specific blood splatter that is invisible, it glows blue and appears for the player. I am struggling as i have never used the Unity URP Shader graph and wouldnt even know where to start. Its an important part of the game that i am making.

tacit parcel
vivid sleet
uneven geyser
#

@regal stagyou are amazing!! thankyou so much!

proven rapids
#

Hey! I would love some help. I am trying to make PSX style game and I have all the pieces to the puzzle except for glass. I can't get the Glass material to work and pixelate like other materials

uneven geyser
#

@regal stag is it okay if i DM you please? Im like brand new to shader graphs! aha

dusty creek
#

I'm practicing with the Fullscreen shadergraphs and was wondering if it makes a difference if I make each effect in seperate graphs or if I should make all the effects in 1 graph and blend them over eachother?

halcyon panther
#

Bump.. again.

regal stag
#

render some effect (a texture) at a specific location on the map

regal stag
dusty creek
grand jolt
#

What's the problem with this shader?

#

quick solved it by adding a font material to the worldspace text

#

dunno what's wrong with the shader tho

#

does materialless renderers gets confused when another thing with shader overlaps with them?

uneven geyser
#

@regal stag Hello, im having an issue, the decal projector isnt projecting the material however if i drag the material onto a normal object and shine it with a torch it glows, im not sure why the decal projector isnt projecting the material

vocal narwhal
uneven geyser
#

@vocal narwhal i did get it working, just had to restart my unity, it was bugging out aha

river vine
#

Hello everyone 🤗.I had a question, I wanted to know how to use the old mask method in Unity? The same way of saving a photo to a black background and then with a photo that is like the first photo completely white, I don't know how to do that.

grizzled bolt
tame topaz
#

@river vine Please don't crosspost across multiple channels. This is where your question belongs.

river vine
grizzled bolt
#

If you actually want some type of masking, you'd have to clarify if you want to do it on textures, with sprites/images or with shaders

prime shale
#

I think he might mean using the mask as transparency or as an alpha mask

grizzled bolt
prime shale
#

It does but he mentions compression, so maybe he means having separate textures to keep file size down (although honestly it wouldn’t really matter since the texture gets converted to a different format with unity anyway)

river vine
regal stag
river vine
regal stag
#

Would change when adjusting format/compression with these settings

grizzled bolt
#

"Jpg" and "png" and all the normal image formats cease to be when building
Any artifacts from lossy compression until that point will be cemented into the data of the new format

jolly ravine
#

hi, has anyone had an issue with unity removing preprocessor directives from shaders after clicking on play/reloading the editor? I'm updating a shader from a package I own to support HDRP and after doing some changes and adding preprocessor directives unity just removes them, I'm using unity 2021.3.21f1

wintry quartz
#

Hello!

#

I am having some shader problems

#

an cant seem to know whats wrong

#

I was wondering if someone could help me

#

✔️ Works in 2020.1 ➕ 2020.2 ➕ 2020.3

Oftentimes, it's useful to set shader properties from a C# script. In this video, I show how to set property values on a shader created in the URP shader graph. In the process, I create a system that draws colored ripples wherever you click on a mesh.

👋 Subscribe for weekly game development videos!
https://...

▶ Play video
#

trying to make this

#

but nothing happens when I click

#

and I did everything in the video

#

is something outdated?

oak summit
#

How do you make a shader fade to black depending on the distance from empty space(for a tilemap)?

neat elbow
#

I want to create a flash effect which is triggered on enemies when damage is dealt to them. These will be 3d models. I don't want lighting to affect the models when applying this flash. What's a good way to build this effect?

#

This flash would have their model becoming bright, nearly solid color, for just a moment.

#

How do you blend between a lit shader and an unlit shader?

grizzled bolt
# oak summit How do you make a shader fade to black depending on the distance from empty spac...

Shaders cannot do this because they have no information about which tile they are or where other tiles are
I think usually the method to do that is to run a flood fill type of algorithm on the negative space tiles and store the results in a texture or a new tilemap, which is then overlayed onto the first tilemap
It's a pretty heavy operation to do in realtime so games use compute shaders or multi-threading for it if possible

oak summit
#

Uhh
Okaaay
Thank you

gilded ridge
shadow locust
#

This value is just a single number

#

Between -1 and 1

#

Plug it into a "y" node somewhere to make it apply to the y axis

gilded ridge
#

thanks! i did it

inner birch
#

Hi. Is it possible to modify Unity Toon Shader.(v3)

#

I want to change the Zalways parameter.

#

Is there a way to do that?

ocean cairn
#

What's the maximum number of bones a skinned mesh can have in total?
I know its limited to 4 bones per vertex however I cant find any documentation at all that mentions the maximum total number of bones.

I did some testing and there seems to be a limit of ~500 bones but it varies from mesh to mesh and I would like to have a actual number.

trail reef
#

How can we create hifi rush style shader and material in unity3d ?

vital barn
#

Hi, i hope someone can help me here: I have a smoke shader (from the asset store, from Knife) which compiled on various machines. Now I have moved the complete dev environment to a new machine with another graphic card and now I get "Shader error in '': Parse error: syntax error, unexpected $end, expecting TOK_SHADER at line 1". I have no clue what is going on here: thanks!

hollow wolf
# trail reef How can we create hifi rush style shader and material in unity3d ?

Inspired by the release of Hi-Fi Rush by Bethesda, I wanted to see if I could get a similar vibrant and stylized aesthetic in Unity. Little did I know, it would swiftly lead me down a rabbit hole of custom rendering in Unity and, in turn, completely overhaul my entire perception of Unity's Scriptable Render Pipelines. This video is a showcase of...

▶ Play video
#

it's going to be hard since the documentation and the example is hard to find

turbid heart
#

is there a way to convert my vector4 into a texture? Sorry if my wording is terrible, first time doing any work with shaders, but i was looking to try and combine a procedural circle with a pixelation effect, and i've seen people do the pixelation by just applying it on a texture using sampletexture2d, but in my case i don't have a texture

or maybe is there a node that does the same thing that sample texture 2d would do here

vocal narwhal
#

Then you can just use a step, or sample a gradient to get the above

turbid heart
#

well i already have the circle above, i was just curious if I could sort of pixelate it using the node below. For example, if i save the above node's result as a png and use it with a sampletexture, i get this result, but i'm wondering if it's possible to achieve this without first saving it as an asset or whatever

vocal narwhal
turbid heart
#

that makes a lot more sense, seems to be working fine for the most part

#

just gonna try to remove those artifacts now

#

thanks for the help!

opaque bloom
#

hi everyone, I have an issue with effects. I have main camera with effect that makes old/pixelated effect on camera which works perfect and I have another camera that shows only flashlight so it wont clip trough walls. Issue is, effects on main camera works on everything except flashlight and I want it to work on a flashlight too...Here are some screenshots of my two cameras.

#

I want it to look like this, this is when main camera also render my flashlight but now it will clip with walls...

balmy cedar
#

Hey everyone. I'm currently facing a problem I cannot solve at the moment. I'm trying to create an intersection mask for my water caustics. so basically everything that intersects with the water should turn white. This works for all convex meshes (cubes, sphere, ect.), because you cant see the outer wall from the inside or though the object itself. I use a 2 pass shader for that with ztest greater which is a basic approach for that.
As you can see in the image I have a "bend" river mesh (2), that runs along the terrain curve (1). You can clearly see the outer wall through the inner wall from inside the mesh and outside, which ruins the mask I use in post processing.
I tried almost all stencil, ztest and zwrite settings and I am getting kinda frustrated.

Does anyone have an idea or faced the same problem and got it solved? Or is it simply put unsolvable?

Thank you!

true steppe
#

Is there a way to replicate Unlit surfaces in a Lit shader? I have my UVs for color, smoothness and the third one would be for "light". Emission won't do here, what else is there?

sand fulcrum
#

i wonder how stupid it is to do shadows (for 2 objects only) like this, because i want good shadows for them specifically, but URP is lacking
- have orthographic camera follow object, same angle as sun
- do some layer/shader stuff so it renders completely white, and black where the object is
- use that texture as a decal on the ground
HMM

ancient drift
#

is there a way to have a texture tile alongside the UV of a mesh at the duration of the particle's lifetime?

ancient drift
#

so i'm extracting the three channels to get three different textures. However I want to treat each of those textures extracted as completely white so I can change the color of each part of the slash to whatever color I want. In the vid I want the big blue part of the slash to be red but it's still blue.

Is there a way I can take each of the channel's textures and treat them as their own grayscale texture so they can take any color?

#

nevermind found my solution

#

it was addition

#

not turning it all into a vec4

true steppe
tacit parcel
civic lantern
fiery moth
#

I am dealing with a compatibility issue when building for webgl. I have narrowed it down to these two lines in my shader script on my camera:

Graphics.Blit(src, renderTexture, passthroughMaterial);
Graphics.Blit(renderTexture, dest);

passthroughMaterial is a debug shader that just samples the main texture and returns it unchanged. So this snippet should just blit the main camera texture into a render texture, and then blit it from that render texture to the screen.

On one machine, this snippet results in a successful passthrough. On another machine, this snippet results in a black screen. Meaning it must be a compatibility issue.

The following snippet results in a successful passthrough on both machines:

Graphics.Blit(src, renderTexture);
Graphics.Blit(renderTexture, dest);

So it must have something to do with the material.

Any pointers on what the compatibility issue might be, or how to investigate it further? Thanks.

#

Are there any glaring issues with my passthrough shader? I am a bit of a newbie when it comes to shaders. The purpose of this passthrough shader is to do nothing to the texture:

Shader "Custom/Passthrough"
{
    Properties
    {
        _MainTex ("Texture", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 100

        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag

            #include "UnityCG.cginc"

            struct appdata
            {
                float4 vertex : POSITION;
                float2 uv : TEXCOORD0;
            };

            struct v2f
            {
                float2 uv : TEXCOORD0;
                float4 vertex : SV_POSITION;
            };

            sampler2D _MainTex;

            v2f vert (appdata v)
            {
                v2f o;
                o.vertex = UnityObjectToClipPos(v.vertex);
                o.uv = v.uv;
                return o;
            }

            fixed4 frag (v2f fragment) : SV_Target
            {
                return tex2D(_MainTex, fragment.uv);
            }
            ENDCG
        }
    }
}
fiery moth
#

The solution seems to have been to enable ZTest Always in my shader. I still need to do more testing on other machines, but it works for now.

true steppe
true steppe
#

I tried just using that, but the performance was terrible.

grizzled bolt
true steppe
#

I just clicked the emission node thingy, and deleted it? Because it's not in use?

grizzled bolt
true steppe
grizzled bolt
# true steppe Maybe you missed this 😄

I assumed you meant in reference to built-in render pipeline
Emission output should have less than negligible impact on performance since it's no more than an add operation

true steppe
#

Yea that thought hit me as well, is the SRP way better with emission for mobile?

grizzled bolt
true steppe
#

Oh ok!

grizzled bolt
#

If you have a performance problem it's not related to shader emission I'm fully certain

true steppe
#

Same shader, same everything, but the emission output was used.

tacit parcel
#

is global illumination set to realtime in the shader/material? try setting it to none

true steppe
#

I am not sure actually, could be!

tacit parcel
true steppe
tacit parcel
#

it's not shader graph but maybe it's there on shadergraph too

#

even on builtin, emission should be almost free, except when it has to affect global illumination in realtime (maybe)

grizzled bolt
# true steppe This is actually good to know, is emission actually this simple?

Yes
I would think it only could affect performance if enabling it breaks some type of batching in your scene, but 50% loss is worse than the worst case scenario I've seen, and that shouldn't be unique to Emission
Or it's some editor bug related to shaders that might vanish on restart, or we're barking up the wrong tree entirely

#

The global illumination option should only have an impact when your emissive objects are static, you've precomputed Enlighten's realtime GI and on top of that changing the emissive color during runtime
But that shouldn't be too expensive either as Enlighten is designed to handle that

true steppe
#

The draw calls are in high 30s at it's worst

#

I plugged the UV2 in to the emission node, and boom, performance tanked.

grizzled bolt
true steppe
#

The goal was to have one shader and one texture atlas for the whole game. UV0 for color, UV1 for smoothness and UV2 for "light source" so emission. I previously just used an unlit shader for those surfaces.

grizzled bolt
true steppe
#

Oh wow, you feel like that's necessary?

grizzled bolt
#

That type of performance drop makes no sense, so I'd try to isolate it and rule out any editor and project related issues

#

Having an empty test project in parallel isn't a big deal, and it's really useful for problem solving
Remember to make test builds too

cold ermine
#

Hi! I'm struggling a bit with my shader. Before, I had a circular plane mesh that grew and shrank depending on the units Attack Range. Easy enough. But now I want a ring on the edges of the circle. Anyone know how to go about this?

#

I've tried just doing a 'ring' shader with radius/width variables, but I realized that I can't have independant range indicators then, as adjusting the 'radius' of the ring would apply the change to all indicators that have the shader.

wintry quartz
#

Hello, I have a problem with the reference from a graph class

#

I do get a print out

#

but the ripple never gets called out

regal stag
cold ermine
regal stag
woeful breach
#

can i cancel pasting nodes into the shadergraph ?

cold ermine
regal stag
woeful breach
#

its pasting for 36 minutes now TT

regal stag
cold ermine
regal stag
wintry quartz
vague pilot
#

Hey,

Do you know how the Depth-Texture is generated? is it generated using ray-marching?

grizzled bolt
#

A pixel's depth can be figured by knowing where the polygon's vertices are relative to view frustum

true steppe
#

Thanks!

grizzled hull
#

Hi all!

I'm attempting to use shadergraph to modify transparency (i.e. the alpha value) of a model based on a color in a UV. I'm in URP.

My shader samples a UV texture, and if the sample matches a 'TransparencyColor', it should return an alpha value for transparency (e.g. 0.25). If it doesn't match, it'll return 1.

Attached is a screenshot of my shadergraph.

Here's the code I've connected to my Custom Function.

#ifndef COLORCOMPARE_HLSL
#define COLORCOMPARE_HLSL

void ColorCompare_float(float4 InputColor, float4 ComparisonColor, out float3 Out)
{
    float result = (InputColor.rgb == ComparisonColor.rgb) ? 0.25 : 1;
    Out = float3(result, result, result);
}
#endif

I've just started learning about shaders, so I may well be tackling this problem in the wrong way. Any help would be much appreciated!

grizzled bolt
true steppe
regal stag
grizzled hull
#

Color Mask node worked perfectly, thanks again @regal stag !

frozen jetty
#

Hello. I am trying to make a shader that creates a tile, depending on local coordinates, and can create a tile per pixel per unit. I want it to work as a UI Image tile mod. Right now, it creates a tile using a simple uv multiplication, and the frac function, and when I resize the image, the tile is stretched. How can I make it so that the tiling is independent of the rectangle?

i.uv *=4;
i.uv = float2( frac(i.uv.x),frac(i.uv.y));
left spindle
#

Hi!
I've made a fog shader for my game. It's been working fine but now I need to use it so that it "offsets" differently. How can I achieve the desired functionality as seen on the video?

Both of the objects are UI images, and the one on the left has the bool "OffsetWithCamera" (may not be the best name ik) set to true, while the one on the right has it set to false. I've tried to use a default UV0 and multiply it with some values, but as you can see it gives a stretched result, and stretches even more when the aspect ratio gets bigger.

jade maple
#

Hello, I am trying to use the _CameraDepthTexture buffer for my scene, however, it seems to be either completely black or white, not grayscale. I am not sure why.

rigid wagon
#

hello

#

can someone help me figure this out

#

I have a visual effect on the screen that works but I cant see the scene

left spindle
rigid wagon
#

what do you mean

left spindle
rigid wagon
#

yeah

#

I do

left spindle
#

Okay, we (i) need to see it in order to help

rigid wagon
#

this

left spindle
#

Any higher resolution for the picture?

#

You can't see the text in it

rigid wagon
#

trying to clean it up so you can see it

languid viper
#

I have a shader that sets a material's emission if a purple light is touching it as a blacklight reveal, in URP Forward this works perfectly fine. however in Forward+ it seems there's some depth issue(?) because now it only works if the camera gets very close to the objects or if the camera is turned at just the right angle and i'm not entirely sure how to correct this.
for the cube object in the video i just pass its world position using the position node

left spindle
#

Alr

rigid wagon
#

fixed

left spindle
#

Now it's better but still quite noisy

#

Can't really see what the values are set to and stuff

rigid wagon
#

its hard to zoom in beccause you wont be able to see the whole set

languid viper
# languid viper I have a shader that sets a material's emission if a purple light is touching it...

also for the decal position, i did whatever the hell this math(in the attached image) is using the view direction, camera direction, and scene depth. i don't understand how exactly it works, i just happened to find it in some random unity thread a few months ago

and if it matters, the actual shader code is this: https://hatebin.com/liwyfjsgmz
where the inputs are the position, the color and possible intensities of the blacklight, and the output color

rigid wagon
#

did you mean like this

regal stag
# rigid wagon

What is the Sample Texture 2D node in the top right sampling? You may want a Texture2D property called _MainTex in the texture input.

Though if this is a Fullscreen Graph in URP, I'd replace it with the URP Sample Buffer node with mode set to "Blit Source"

rigid wagon
#

how would I do that

regal stag
rigid wagon
#

alright

regal stag
rigid wagon
#

I dont think I have the URP sample buffer

regal stag
#

Would depend what render pipeline and unity version you're using. How are you applying the shader to the screen?

rigid wagon
#

im using 2022.3.16f1

#

and the URP is High Fidelity

#

Universal Render Pipeline

regal stag
#

How are you applying the shader to the screen?

rigid wagon
#

I mean it looks like this

#

the shader works but the scene is mad dark

regal stag
rigid wagon
#

I got a Sample Buffer Script

languid viper
rigid wagon
#

but not node

regal stag
# rigid wagon I got a Sample Buffer Script

Not sure what you're referring to.

The shader is dark because it's outputting black for those pixels. You need to use the output of this node (highlighted in red), into the T input on a Lerp node, with B set to the color property and A set to the camera view before the effect was applied. That depends on how you're applying it to the screen, could be sampling a _MainTex texture or the URP Sample Buffer node.

Or maybe use that highlighted node as the alpha and color property in base color, assuming the method you're using to apply it to the screen supports transparency.

rigid wagon
#

tbh Im confused

#

Im sorry

regal stag
# jade maple Hello, I am trying to use the `_CameraDepthTexture` buffer for my scene, however...

The depth texture usually ranges from 0-1 between the near and far camera planes. If the far plane is very far away it would make sense most values are close to white. If you can, change it on the camera component.
Also if it's a perspective camera, depth would be stored non linearly, there's functions like Linear01Depth and LinearEyeDepth for converting it.
For ortho, it's already linear but might need remapping (also may want to take into account #if UNITY_REVERSED_Z to properly support all platforms)

regal stag
jade maple
regal stag
jade maple
#

ah i see

#

ty

burnt pollen
#

Hello!

In Blender I have this brick wall object set up with 2 UVs:
One with the brick wall texture
The other with the graffiti message written over a transparent field (black field with alpha set to 0)

How do I recreate this in unity now?

The reason I have them in two separate UVs is because the brick texture is tiled seamlessly, so the message could not be included on the same UV.

Can anybody provide any insight please? Any help is appreciated

vocal narwhal
burnt pollen
burnt pollen
vocal narwhal
#

I have no idea what render pipeline VR Chat uses, it could use default for all I know. Though, a settings folder is not required in any project.
I imagine it doesn't use URP, and even if it does I doubt it's on a version that has decals

#

in that case you would need to manually create one with a transparent cutout material on a quad that floats a little in front of the wall

burnt pollen
#

cute

#

ok

#

thanks

#

going to experiment with this, will return with update on if it's a solution

#

or, maybe the projector?

latent mirage
#

Hello devs , combined 2 shaders by myself but got this Warning :
" Use of UNITY_MATRIX_MV is detected. To transform a vertex into view space, consider using UnityObjectToViewPos for better performance. "
I've tried all fixes from forums but nothing helps, can someone help

Here is Shader
https://codefile.io/f/lk6G4syBPv

hidden matrix
#

Does anyone have a couple of minutes to talk with me about how to get a linerenderer working with glow? I am having lot's of issues, and I have never worked with a lit environment before

broken locust
#

I want to make a side view mirror for my car, im using a camera view as a texture and assigning that texture to a plane, however this plane i have is rectangular, my car's side view mirror is a circle, i try putting this same texture on the right mirror component of the car but i think its too zoomed in or something. Any solutions?

hollow wolf
broken locust
hollow wolf
#

ofc you can do some optimization such as rendering impostor for the mirror camera instead of the real 3d

broken locust
hollow wolf
#

since it's like using camera render texture but in steroid

#

*if you'r project is in URP

hidden matrix
#

I'm using URP with a 2D project, glow from a shader I made isn't working. I'm not trying to do anything fancy, just apply a glow to a moon texture I have

#

The way I have it set up, the moon doesn't glow the background, but regular 2D lights will

#

From this:

#

To this:

#

This is the shader I have, I just copied it from a tutorial I found

tacit parcel
tacit parcel
# broken locust Ok will do thanks. I read from a website that this method was more resource inte...

that's true actually, using camera render texture could be more performant since you can control how big the render texture size. And you'll have more control on mirror fov(car rear mirror usually have larger fov than plain mirror) and range (limited range means usually more performant)

As for the problem, check your mirror uv, seems like the uv is too small so it only shows a small portion of the texture

broken locust
#

I ended up using a cylinder as my "mirror" instead, thanks anyway

grizzled bolt
#

Also that's one of the glow tutorials that have it wrong
Multiplying the sprite color doesn't make it glow in the darkness because it's multiplied by the light texture also

left spindle
left spindle
#

Came up with this solution and now it works.. somewhat
Because it is getting the aspect ratio from the screen, the rect's aspect ratio must also always match the screen's aspect ratio. So this leads to stretched results when the aspect ratios don't match..

ancient drift
#

hi so i'm using a packed texture in order to separate the three textures later and I want to know how can I apply the tiling and offset node onto an individual channel cause I want two textures to use one offset curve and the third texture to use a different offset curve.

tardy spire
#

is it possible to mask a urp decal using stencils so that it only draws where the stencil value is equal?
I tried making a lit shader that writes an arbitrary stencil value

Stencil
{
    Ref [_StencilValue]
    Comp Always
    Pass Replace
}

and then in the decal shader

Stencil
{
    Ref [_Stencil_Ref]
    Comp Equal
    Pass Keep
}

but no matter what Stencil Value I set, the decal only seems to pass if its Stencil Ref is between 0 and 1

#

Both shaders were originally generated via shader graph and I copied the generated shader into a new one so I could add the stencil sections manually. I added a stencil block to each generated pass, and added a int _Stencil_Ref; to each passes cbuffer.

hidden matrix
grizzled bolt
hidden matrix
#

Well the ultimate goal is to have a light source along the length of a line renderer which changes programatically. If bloom isn't the right approach, there should be another way to dynamically make a lightsource match the shape of another object

grizzled bolt
hidden matrix
#

Yeah I just found out you can dynamically make freeform lights. It seems to be working in some testing I am doing, but I haven't finished the script yet. Thanks for the help

mental bone
ancient drift
#

sadge ok well thanks

uncut whale
#

Hello, I have a question about shaders. I bought the asset where creator said it's support the HDRP and URP. I use HDRP in my project so I bought it.
I convert materials to HDRP but I have a problem with custom shader from this creator. How to convert them to work in HDRP?
The creator assumed that it was easy and everyone could handle it, so the question is: can it be done with a few clicks?

sullen cobalt
#

Hey so, I've got a custom shader that implements a 'damage flash' for sprites, and that's about all the shader does. However, I also have 3D objects in the scene and when I apply the custom shader to a rendering pipeline asset and use that asset in Project Settings > Graphics, then the 3D objects go pink and if I use 'none' there instead, then the sprites go pink instead. I understand that I probably need to implement a 3D shader myself inside of the custom shader for both of them to work together, but I don't really know how to do that.

grizzled bolt
#

Maybe you missed the HDRP version / HDRP compatible materials/assets
Or there are none and the labeling is a mistake

#

Totally custom shaders can't be converted at all
If they're URP Shader Graph shaders then they may work just by changing the Target to HDRP in Graph settings, but that's not usually expected of the user

grizzled bolt
uncut whale
grizzled bolt
uncut whale
#

hmmm I dont see them, I will re-import the whole asset

sullen cobalt
# grizzled bolt Which render pipeline is your project using and which render pipeline are your s...

I.. honestly am not good at shaders so I might tell you the wrong things, but we'll see. I'm using an UniversalRenderingPipelineAsset which has one thing in it's Renderer List, being an UniversalRenderingPipelineAsset_Renderer. The shader itself is as seen on the picture. I used this video as a guide https://www.youtube.com/watch?v=rq6yGh-piIU&t=646s, but as far as I remember, I needed to make some adjustments to the shader in the video because some stuff was different for me than it was for them. The npc textures/materials have their shader set to the DamageFlash shader

uncut whale
grizzled bolt
viscid lark
#

hello does anyone know how i can rotate the simple noise texture so its displaced like on the xz axis and not zy axis in the shader graph?

uncut whale
grizzled bolt
viscid lark
#

so the i would like to let the right one look "correct"

regal stag
viscid lark
#

and i am using world position

sullen cobalt
uncut whale
viscid lark
vocal narwhal
#

sure but use xz as the mask, like they said

grizzled bolt
grizzled bolt
viscid lark
sullen cobalt
#

Wait no, I'm dumb

#

Mixed up a couple things there

grizzled bolt
#

With the shaders, or vice versa

#

With Shader Graph this compatibility is defined in Graph Settings

sullen cobalt
#

Could it be this?

grizzled bolt
#

2D Renderer doesn't support Lit shading, but it wouldn't appear pink

sullen cobalt
regal stag
# uncut whale I have ShaderGraph in project but I can't see this file:

Might be related to this : https://forum.unity.com/threads/tons-of-assets-broke-with-minor-editor-release-2022-3-10f1.1496333/
If there are shader files containing that include, maybe swap it to the #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" one mentioned in that post, or try updating Unity.

regal stag
grizzled bolt
sullen cobalt
grizzled bolt
#

They should match the render pipeline you want to be using

regal stag
#

Yeah, if you've swapped render pipeline, other materials in the scene will still be using old shaders intended for Built-in RP. There is a material converter that can fix that.
Switching pipeline affects other things too though, like post processing and various assets. You should be sure you need URP before switching. Shadergraph can also target Built-in if necessary.

sullen cobalt
grizzled bolt
sullen cobalt
sullen cobalt
grizzled bolt
sullen cobalt
grizzled bolt
#

Wait, I had that discussion with you squint

summer pagoda
#

I am having an issue with the vertex shader that I am using for terrain, the subshader setup is -

Tags {
    "Queue" = "Geometry-100"
    "RenderType" = "Opaque"
    "TerrainCompatible" = "True"
}

CGPROGRAM
#pragma surface surf Standard vertex:SplatmapVertEx finalcolor:SplatmapFinalColor finalgbuffer:SplatmapFinalGBuffer addshadow fullforwardshadows
#pragma instancing_options assumeuniformscaling nomatrices nolightprobe nolightmap forwardadd
#pragma multi_compile_fog // needed because finalcolor oppresses fog code generation.
#pragma target 4.0
#include "UnityPBSLighting.cginc"
#include "UnityCG.cginc"

#pragma multi_compile_local __ _ALPHATEST_ON
#pragma multi_compile_local __ _NORMALMAP

#define TERRAIN_STANDARD_SHADER
#define TERRAIN_INSTANCED_PERPIXEL_NORMAL
#define TERRAIN_SURFACE_OUTPUT SurfaceOutputStandard
#include "TerrainSplatmapCommon.cginc"

The problem is that the vertex shader code stops working after camera is some distance away from the patch of terrain, is this something that can be fixed? The only solution I found is to increase base map distance, but that also has a side effect of having more textures loaded in vram which I dont really want.

I rather have it render at a lower vertex count that stop working all together...

#

Close up (1st picture) and Far away (2nd picture) where you can see that the terrain starts to clip the water line (Which is a separate plane with a custom material)

grizzled bolt
summer pagoda
#

Well I assume so, here you can see it better with the white lines/gaps

#

I could increase base map distance and decrease the resolution of that base map to mitigate vram problem but thats also not ideal

sharp moat
#

okay so i opened up an older file thats unfinished and have no idea what im looking at. looks like i lost all my work

#

is there a way to get it back. kinda desperate

#

ive got the shader graph downloaded from the package manager and i cant even make a new shader graph even if i wanted to

grizzled bolt
sharp moat
#

ill try making a new scene like you said too

#

just checked, my shader folder is empty...

#

the file is low key just gone...

sharp moat
#

welp, guess im gonna have to do my task again. ah well..

drifting flare
#

In URP in a shader graph, how do I get information from a point light?

#

The point light does change position, but I only have to care about one point light

grizzled bolt
drifting flare
#

Thanks so much. It's weird that Unity natively supports getting a sun light but not a point light in shader graphs

#

I've done it in HLSL before but really struggled lol

nova needle
#

Hey everyone! Does somebody know why the alpha channel gets ignored here?

#

the noise texture on the bottom is scrolling with time, as it should, but the upper left texture is not affected, even though the noise output is connected to its alpha channel

#

Or, maybe a simpler example of the same problem:

regal stag
# nova needle Hey everyone! Does somebody know why the alpha channel gets ignored here?

Node previews don't show transparency, and the "Base Color" port in the master stack is a Vector3. So the Vector4 input is being truncated to it's RGB components.
If you want the graph output to be transparent, you need to change the Surface Type under the Graph Settings, then an Alpha port will appear where you can connect your sample output (or Split/Swizzle the Vector4 to obtain the A output)

nova needle
#

Thanks! Looks horrible but works haha

nova needle
#

Can anyone give me any feedback on all the mistakes I am making here? Would be highly appreciated!

#

For example I am wondering if I really need to be multiplying up the textures (the original one on the upper left, and the scrolling noise) so heavily - but otherwise my output gets very dark

#

Also, if I understood the original video I am following (the VFX of Diablo 3, he doesn't really say much, just show the end result and quickly discuss it), he uses the above thing for RGB and the below cloudy texture only as alpha...but when I do it, it just looks like the above texture with a greyish cloudy stuff hovering above it, quite bad unforunately. So what I do is this multiplication stuff which looks better in the shader graph outputs

regal stag
# nova needle Can anyone give me any feedback on all the mistakes I am making here? Would be h...

I'd add a Saturate (which clamps between 0 and 1) before the Multiply in the top left to make sure there isn't any negative values.

Also, the video you're following isn't using Alpha blending. If you only need the shader to work on dark backgrounds, Additive may work better. For that you don't really need alpha.

If you need it to work on lighter backgrounds too, at 21m into the video it shows an alternative blending which they name "Blend Add". I'm not entirely sure... but I think this is "Premultiply"

nova needle
#

Thank you very much! Going to try this now! 🙂

#

Oh and I just checked your profile and found your website, really nice! Maybe you should try to do some seo haha, I searched for shader graph tutorials a few times, and never found nice stuff, and your website seems to have a few things that really interest me a lot

#

Will check the tornado shader tomorrow in more detail, I recently made a my first vfx graph for a tornado (so using particles, not a shader), really excited to see another implementation

#

do you think your shader will look good when viewed from an above angle? (Think diablo games or RTS)

left spindle
#

In the shader graph ofc

sharp moat
#

so i msde a float in the shader graph but when it connect it and add the shader im making to a material, nothing appears in the surface inputs section

sharp moat
#

also, this is what im meant to be seeing btw for added context

sharp moat
#

fixed it

quick scaffold
#

i saw a very good package of skyboxes, just want to add a flowmap, is there any way i can just write inside this material shader?

#

i didn't find the script in assets

vapid spade
#

hey i did some shader and its doesnt works when i change a local scale x to -1

ember creek
#

how do i make the shadows less extreme

grizzled bolt
ember creek
#

thank you

left spindle
#

Does anyone know a resource which explains how to create a "circular cutoff" shader? Like where you have a black background for example, and then a white circle, wherever that circle is it will cut a "window" into the black background, which will show what's behind

#

Tryna make a tutorial for my game where there is this kind of shader and the circle is positioned at an UI element the user needs to click at

#

It doesn't even have to be circular, anything that explains cutoffs and stuff in 2d

nimble dirge
#

Instead of the solid colour , how do i tell the shader to use the colours ive placed the obejcts uv in? on the left is the tree with the shader and the solid colour, i wanna add the same shader to the tree on the right but keep the colours I assigned it with an atlas from blender

regal stag
regal stag
nimble dirge
vapid spade
grizzled bolt
left spindle
#

Or just sprite renderers

grizzled bolt
left spindle
#

Seems like it's only meant for Sprite Renderers

left spindle
#

Like if I had the circle as the parent and the full bg as the child, and the mask on the circle, it would make the bg shaped like a circle

grizzled bolt
left spindle
#

The configuration is the exact same as in the video (without the scroll rect because that isn't needed) and these are the results:

The image on the left has the mask set to off on the circle (the parent), and on the right it has it set to on. As you can see the right side essentially turns everything into a circle, because that's what a mask is supposed to do (don't render anything outside some area, in this case the circle). I want the reverse of this to happen, aka. render everything outside the circle, but nothing inside.

I could just use an image that's shaped like this. with there being a circular cutoff in the center, but then when I want to scale the cutoff problems arise (unless I used a very oversized image, which I do not want. There must be an easier way).

left spindle
#

Okay I actually didn't google reverse masks yet, I'll watch this video

cursive jewel
#

I have just started learning shader graph, and don't understand why my texture is not tiling or offsetting even we I change the values

left spindle
grizzled bolt
cursive jewel
#

there is a change in tile and offset node.. but in final out no change at all

grizzled bolt
cursive jewel
#

no its not working in shader graph preview

#

just color of tile and offset node in node editor changes

grizzled bolt
#

Specifically changing the Tiling in X axis
Changes to Y tiling and XY Offset may be imperceptible due to the content of the texture

cursive jewel
#

hey thanks.. its working now

lean lotus
#

Random question, is there a way to get the transformed vertices from a shader that deforms a mesh in like the vertex buffer or something?

sinful canopy
#

Hey there, I asked this question a while back in a different channel to no avail, but I'd like to know if it's possible to have a transparent self-occluding shader with URP's Shader Graph, and if not, is there anyway to translate that shader graph to a regular shader and get this function. Here's my original post just for reference: #archived-urp message

sinful canopy
#

Well then, after pressing random buttons and trying out all the graph settings I found out that by setting Depth Write to ForcedEnabled and not Auto did the trick. That would explain why in the scene view it would go back and forth.

modern jay
#

I don’t know where to ask this so lmk if this is the wrong place, but is using a thin cylinder as a line a good idea or is there something else that I should use that’s less power heavy

vague imp
#

Thats why its called a LINE renderer

#

Cuz it renders lines....

onyx cargo
#

Using shadergraph, is there any perf benefit to creating my own tiling/offset vector2s and feeding them to a single tiling and offset node, vs. just enabling "use tiling and offset" on each of my texture2D's?

low lichen
burnt pollen
#

Where do I drop the specular map for my material?

grizzled bolt
burnt pollen
#

Ah could you elaborate?

#

Im new and ignorant - never heard of thi

#

found it.

burnt pollen
#

hello again. any tips for my stupid self on killing these ugly seams?

vocal narwhal
#
  • Putting the seams elsewhere
  • Using a trim sheet and placing trim geometry over the seams
  • Doing some custom shader thing
burnt pollen
#

Ok thanks. Been relying on smart UV project in blender. Guess I gotta learn how to actually manipulate seams, ha

neat elbow
#

In shadergraph, how do you make the shader render on top of everything else?

neat elbow
#

Easy to google that one.

burnt pollen
#

sure is. thanks, bud.

neat elbow
#

👍

neat elbow
# burnt pollen sure is. thanks, bud.

Didn't mean to come off like a dick. I should have just said "In edit mode, select edges, mark seams, etc." was being literal in the "easy to google" part since I've also had to do it recently.

burnt pollen
#

i took it quite literally no worries

neat elbow
#

Cool

bleak ibex
#

I am trying to make the Texture on the Model appear using a Progress Bar, however since the Texture is a color palette my approach does not work as intended. I have a solution in mind, but I don't really know how to implement it. 😕

Has anyone an idea how this can be fixed or could give me a reference to read?

bleak ibex
#

If anyone is interested, I was able to make it work by using the Vertex Position (I previously didn't know that the Position Node referred to the Vertex Position)

vague imp
#

With follow active quads all the quads that youve selected will be placed on after another getting rid of seems

meager pelican
#

@burnt pollenIs that texture seamless to begin with? If not and if you can pull it off, use seamless textures. 😉
There's a way to take a texture sheet and make it seamless. You have to be good at graphic editing though, and it won't work for all sheets. But for Bricks/rocks it can work out.
What you do is to "cut" the existing texture sheet in half on both x and y axis. So you start with upper-left quadrant, lower left quad, upper right, and lower right. You than copy/paste them into a new identical sized sheet in a different order. IIRC you swap them so that you swap diagonals. So upper left becomes lower right, and vise versa. And upper right becomes lower left.

You'll be left with a new sheet that has the seams in the centers as a "cross" in the sheet....but the important thing is that they will wrap around properly in x and y and TILE well. You then have to use a graphic editor to fix up the seams manually, and make the sheet look good WITHOUT TOUCHING THE EDGE PIXELS. And of course your modeling has to respect the seams so they end up meeting properly.

wheat elk
#

Hello i use Shader graph (i am also new to modeling so that could be wrong as well)
and i made a model and shader and all it clips for some reason, but only if the camera is lower than the model itself
if any body knows why this happens or has any tips i would apreciate it

vague imp
wheat elk
#

that pole thing is atached to the ball(aka one modell) and it should normaly render behind or in fron if it actually is

vague imp
wheat elk
#

i meant the inner ball

#

but yes, for the outer one everything is right

vague imp
#

Is its material mode set to transparent?

#

For the inner sphere

wheat elk
#

they all use the same material and depending on a diffrent texture it chooses how transparent it should be

#

is that bad?

vague imp
#

It just... dosnt work like that

wheat elk
#

you mean the internal logic or what?

vague imp
#

Did you look up ur problem on google first?

#

Beacuse im seeing some forum posts with the exast same issue

tropic field
#

I'm trying to write a custom shader, with some stencil buffer thing going on.

Stencil
{
  Ref 1
  Comp Always
  Pass Replace
}

Is there a way I can somehow tie Ref, to not be 1 for all the pixels on the shader, but instead use some sort of function to drive the Ref value.
I am trying to create a material that supports UI canvas masking. And I would like an image texture / alpha value of the fragment shader to drive the Ref value of the stencil shader

wheat elk
regal stag
low lichen
tropic field
#

what I am trying to achieve requires writing to the stencil buffer.
When using the Mask component, with a custom material, the mask component does not work at all

#

however when only using Image component with a Mask component, areas with 0 alpha are also masked out

#

im talking about canvas

#

I have a shader that creates a black and white procedural mask

#

and was hoping to apply this black and white mask to the stencil shader

meager pelican
# tropic field what I am trying to achieve requires writing to the stencil buffer. When using t...

Well, it sounds like "the hard way" somehow, but IDK your process.
OK, so if you have a camera with active render targets and depth/stencil buffers, you can run a stencil pass over/from something and set or reset the stencil bits. The only thing you'd do it set or reset the stencil buffer, you'd use COLOR MASK 0 to not write to the color buffer and also turn depth writes off to not write to the depth buffer. Like Cyan said, you could possibly do a discard operation at the pixel level if you want to apply a conditional operation there.

I suppose another way is to write the color buffer, for example, that "shader that creates a black and white procedural mask" might also be a candidate to write to the stencil buffer if you started with a full-white texture and just wrote the black pixels into the texture AND set the stencil buffer value for them, discarding the white pixels (because they're already white from a previous blit or something).

#

But like MentallyStable said above, stencil operations are not directly in the programmable stage, you can't control it via code. It's a per-pixel automatic operation (for setting). For testing, your fragment program will never be called if the stencil test doesn't pass. It's built-in logic in the rasterization process that happens between vertex and fragment stages.

halcyon plank
#

Im pretty new to using shader graph and was wondering the proper way of using a height map in shader graph as im seeing the option for directly inputing a map seems to not be there

neon blade
#

I have a problem that I can not figure out how to fix.

#

In shadergraph, I want to use flipbook uv and use the output texture as tiles to fill up a 10x10 2d space.

#

It works.

#

But when I try to randomize the flipbook index with a 10x10 texture that contains random number, even though the output result is what I want, it has very thin lines between each tile

#

basically between tiles that have different flipbook index, there is a thin line between them

#

How do I remove these lines?

halcyon plank
#

@neon blade possible a offset i had this type of issue creating procedural terrain and applying a material with a sprite sheet

neon blade
regal stag
regal stag
neon blade
#

Thanks I will try it out

upper sphinx
#

Hey Im generating a 2D polygon mesh (orange) and Im trying to add a color to it which is shifted down to create fake depth. Is this possible?

hollow wolf
#

anyone have good resource for realtime audio visualization shader?

#

for example there's Lasp for VFX but i never heard about audio input for shader

neon blade
cosmic prairie
#

and use the depth as "real" fake depth

#

depends on what you're trying to do honestly, both of these can be tricky to seamlessly use with other things drawing in the same spot

meager pelican
# upper sphinx Hey Im generating a 2D polygon mesh (orange) and Im trying to add a color to it ...

I'd think you'd want to know the "inside" from the "outside" of your (orange) mesh.
If you don't know that directly somehow, you'll have to compute it. This is often done with outlines too. There's a flood fill method (Jump Flood) that can be used to fill the empty space inside. Once known, that is a mask if it includes the mesh's edges too.
Then you'd clip the blue to the mask, probably with a vertical offset .
This entire article is well worth reading, but if you're in a hurry the jump flood part starts about 1/2 way down.
https://bgolus.medium.com/the-quest-for-very-wide-outlines-ba82ed442cd9

Medium

An Exploration of GPU Silhouette Rendering

junior copper
#

Hey
why is my scene "glowing" when getting close to my cube ?

hollow wolf
#

does your scene have post processing?

junior copper
#

no

#

i dont have the issue if i use another node than the shape "rectangle"

hollow wolf
#

that's weird

regal stag
# junior copper example

That's not a black output like the rectangle had though. HDRP is probably adjusting the camera exposure based on the colours on screen. I don't know where the settings for it is though, maybe ask in #archived-hdrp

junior copper
#

ty

tropic field
#
            //Take outputted mesh from vert function, and run frag function
            half4 frag(Attributes IN) : SV_Target
            {
                // color.rgb = IN.uv.y;
                // return color;

                half4 color = 0;
                float f, cells;
                Unity_Voronoi_Deterministic_float(IN.uv, _Time*40, 10, f, cells);
                
                color.rgb = f;
                color.a = 0;
                return color;
            }

This is my frag function

#

for some reason even though I set color.a to 0

#

the object is not transparent

#

more relevant information

        Tags { "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
        LOD 100

regal stag
tropic field
#

I tried that however it is resulting in some wierd artifacting

#

let me show

regal stag
#

Not sure what I'm looking at, but may also want "Queue"="Transparent" in the tags, and ZWrite Off

tropic field
#

Ah. Queue transparent fixed it

#

thanks a bunch

junior copper
#

regarding the "shape" node, how can i make the color transparent EXCEPT for the shape ?
for now i can only change the whole shader output alpha, when i try using colors with alpha 0, its just black

regal stag
junior copper
#

ty, didint know it accepted other than just a float

junior copper
#

currently i have this rectangle effect
can i make the full retancle (screen 2) go all the way down ? (so like "inside" of the mesh), right now it disapears

tropic field
#

do you mean the flashing rectangle on the top face?

#

you would like it to stay longer?

junior copper
tropic field
#

ok

junior copper
# tropic field ok

ty for waiting, here is the idea

i would like the rectangle to start at the top of the mesh, and move all the way to the bottom (a bit like the cyan shader)
ofc still have the infinite repeat effect (here you can see only 2)

tropic field
#

oh, you want an internal face

junior copper
#

i suppose yes

tropic field
#

like you want a top face for the bottom rectangle

junior copper
#

idk the correct name for this

tropic field
#

That will not be possible with a shader alone, as a shader will only draw onto a surface that exists

junior copper
#

but yes the rectangle is "inside the mesh", not only at the faces

junior copper
tropic field
#

one way would be to have a mesh with an internal face, and manipulate the geometry itself through code,
or easier would probably be to get 2 cuboids and create a keyframe animation for this effect

#

in blender or something

#

in any case, for it to draw a face 'inside' there will actually have to be a face inside

junior copper
#

before making the shaders i thought about just doing some rectangls moving
one of the issue is to make the animation seamless, particulary when the rectngle comes at the top

tropic field
junior copper
tropic field
#

can I know what you are making this for?

junior copper
#

i wanted to make a sort of "sci fi" rectangle effect

tropic field
#

i see.. to me personally it seems like too big of a solution to make a seamless animation for this purpose

#

i would recommend trying to find and achieve a slightly different effect that fits your need

tropic field
#

np anytime

quasi glacier
#

Hello there, does anyone know how to somehow make Graphics.Blit() work properly ?

It works fine in editor. Though, when I build my game, I have a black screen and only UI is rendered.
Here's the function I'm using (note that it comes from a free plug-in I've found) :

upper sphinx
#

@cosmic prairie @meager pelican Thank you, I’ll look into it!

meager pelican
quasi glacier
meager pelican
quasi glacier
#

Wait, actually, I have a null ref in my build hum (which is called at each OnRenderImage bc it's the material)

meager pelican
#

There you go. Enjoy. 😉 Debuggers are your friend.

quasi glacier
#

I didn't think about doing a dev build here, as there was eveyrthing working properly in the Editor, which was a stupid mistake.

quasi glacier
#

Alright, it says my Material field is null, though it is set in the editor and is never set to null from script. Wtf is this ? 😂

hushed rune
#

I have a shader made with Amplify shader editor and when baking the GI the shadows are not rendered properly

#

but when using the default URP/Lit shader the shadows are rendered properly

quasi glacier
#

Alright, I solved it @meager pelican ! The solution was to put preprocessor instructions on those two (and suddenly, the Material is included to the project) :

#

And put this to None, which caused the problem when it was on "HideFlags.DontSave"

summer pagoda
#

I'm trying to make a custom skybox shader in built-in rp but I get a problem where envirnoment reflections/reflection probes are just pitch black, no skybox is visible there

#

I've been debugging this for hours at this point, really not sure what's going on, except I know its a shader problem

sinful hedge
#

Having some issues with URP and a Shadergraph blur shader in 2023. I can confirm all the calls are being made and the data is all set up right via debugging, but nothing seems to happen graphically. I even was following the official blur tutorial with the only difference being the shader. 🤔

#

is there something I'm missing that isn't obvious?

#

I found something online saying that I should set it to forward rendering but there is no option for that even though I go where it says

#

so hmm

hollow wolf
#

forward and defered option only shows on unity 2021+

sinful hedge
#

2023

#

Rendering Path altogether doesn't show up

#

2023.1.20f1

#

so it's relatively recent

#

I got the nov 6 release of shadergraph as well

#

which seems up to date for non-preview

#

15.0.7

sinful hedge
#

oh I see, I'm using the 2D renderer

#

because pixel perfect complains about it

#

but it doesn't have options

#

so I tried that and still nada

#

doesn't work on Forward, Forward+ or Deferred

#

the timing is set to TintRenderPass.renderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing; so I should be able to see it if I'm doing it right...

knotty bough
#

Does anyone know why a Shader Graph shader would look differently in the Game, View tab as opposed to the Editor View tab?
(First image is Game View, incorrect. Second image is Editor View, correct)

#

Additionally, this issue is fixed if the Canvas which the Shader Graph is in is moved to Camera Screen Space.

sinful hedge
#

I did go out of my way to confirm that the shader works outside of the shader feature when set to sprite mode

meager pelican
# summer pagoda I've been debugging this for hours at this point, really not sure what's going o...

Huh. First off, bake lighting if you're not doing realtime (your picture shows baked lighting).
Is the skybox material/shader set properly in the lighting tab? Did you start with a unity one (from source) and modify it?
The skybox shader is called after rendering opaque geometry. The reflection probes should be called after that.
Note that Skybox materials are a special case. Unity draws Skybox materials after all opaque geometry (after queue index 2500), but before all transparent geometry (before queue index 2501).
https://docs.unity3d.com/Manual/built-in-rendering-order.html
So check your render queue number for proper values. See the source code for one of unity's skybox shaders.
I can't tell from your post if your skybox shader is working or not. Maybe output red or something to debug it.

sinful hedge
#

what mode should shader features shaders be set to?

sinful hedge
#

got it 😎

gusty hinge
#

This is the first time I have written shader code. I am following this tutorial to help wrap my head around it all.

Traditionally, the code on the right of the screenshot was written in a .shader file I believe, however I am using Shader Graph in 2022.3.15f1 and can't seem to find a way to edit the custom function node through a text editor in Unity.

Can anyone help me figure out how I can follow this tutorial and write the shader code?

hollow wolf
#

you can only directly write the code inside the custom node tho, i prefer using "file" type instead of "string"

#

*if the code is long

gusty hinge
#

@hollow wolf Could you provide instructions on how you were able to achieve this settup?

#

https://www.youtube.com/watch?v=gw31oF9qITw
This is the tutorial I'm following if it helps!

The third devlog about my yet to be named cozy creature collecting and management game. This one covers my initial implementation of cel shading in Unity.

✔️ Corrections
None yet! 🤞 If you find some information that is wrong or some visualization that looks buggy, please let me know, it’s very much appreciated!

🔗Socials
Follow me on Twitter
h...

▶ Play video
hollow wolf
#

well, just write the code inside the custom node and make sure to pay attention to the input and outpu type value

gusty hinge
#

@hollow wolf Thank you!

hollow wolf
hushed basin
#

what happen with my node?

vocal narwhal
hushed basin
vocal narwhal
#

Yes, completely normal

hushed basin
#

im i wrong some where? the alpha look incorrect

vocal narwhal
hushed basin
vocal narwhal
#

Perform the colour logic as RGB, and separately pass a float A into the alpha output. Trying to do it all as RGBA is confusing you and hiding what the alpha looks like in certain steps

hushed basin
#

the main preview show look correct, but the "Game" show black, and the "Scene" show nothing, im so confusing @@

hushed basin
#

@vocal narwhal sir, are you there?

vocal narwhal
hushed basin
#

@vocal narwhal ty, outline is work but now i got a weird trouble, they are all on a canvas

grizzled bolt
#

2D sorting is not "supposed" to work if you're not in 2D view

vocal narwhal
#

Canvas requires it's own shader setup iirc. Are you also using the Image component?

grizzled bolt
#

Them being on a canvas is important information though
Canvas doesn't use 2D sorting

vocal narwhal
#

Does UGUI work with/have a shader graph? I forget, I haven't used it for a while and I just modified the built-in shaders

hushed basin
grizzled bolt
regal stag
#

Should be a Canvas type graph in 2023.2, otherwise need to use a Screenspace-Camera canvas, not Overlay.

little wing
#

Is it possible to do basic cubemapped/mirrorball reflection shader with just texture combiners/vertex shaders, without using pixel/fragment shaders?

smoky widget
#

How can I have a shader variable skip parts of a shader?

#

I have a float that, if it's zero I want it to skip a part of code, otherwise, do the part. The float can have any value, but if it's zero I just want to fully skip a part

#

It's a parameter, so pre set on the shader and always the same value

#

I know of keywords, so ideally something similar to #if defined, but #if var > 0 do something

regal stag
# smoky widget I know of keywords, so ideally something similar to #if defined, but #if var > 0...

For variables/properties you'd use a regular if statement. https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-if
Though it's a little hard to say whether that's actually going to skip the calculations or just discard the result - the compiler might choose to flatten the branch.

Keywords are probably better if you definitely need to skip the calculations and don't mind the shader variants (as they won't batch together)

compact reef
#

i had dither crossfade feature in a simple unlit shader using "if def" , for example, wont this feature be excluded from the gpu computation if that is not being used?

smoky widget
#

yup, but how do you know if it's being used or not? unless you have a keyword, i think unity just doesn't compile the code rellevant to the things inside the #if statement

#

In my case I have a parameter dividing a set of values and then doing a texture sample. However, if that parameter is 0 i would like to skip all of that

compact reef
#

lacking certainty about it, thats the problem

smoky widget
#

yeess..? im not sure xD

compact reef
#

hope it will be answered

compact reef
#

im just roaming here and there on the website, didnt got collided with a sense making solution

smoky widget
#

You can read the convo from here until I disappear

#

I think going to that message and reading above and below might get what you need

compact reef
#

thank you , im checking it out

smoky widget
#

np

smoky widget
worthy axle
#

Hey folks, since I'm very new to the shader topic, I wanted to ask for some advice.
I would like to create a shader that makes a predefined square from an image transparent or cuts out a square. (At best there should be a slight alpha gradient)
There should be a function that sets a cutout at given positioning data.
The number of cutouts should be able to vary.

Background:
I would like to have a panel that shows an image. Above this there should be a full-surface black panel in which a square area always becomes transparent via positioning data . It is a part of the game in which the background should become visible as the game progresses.

regal stag
regal stag
wild pine
#

I made a shader for a transparent material that should appear opaque most of the time. However that causes the faces to render in a weird priority. Anyone know what causes this and/or how to fix it?

#

It is a transparent material so that I can make certain parts of it see-through, so if there's a way to that with an opaque material that would also be a possible solution

low lichen
#

Your dissolve effect appears to never be half-transparent, always either 100% opaque or 100% transparent. In this case, you can use alpha clipping instead of transparency/blending.

wild pine
lavish owl
#

Hi, I am making a 3d game and I think I need to make a shader mask. I have 2 walls (black). Enemies (red) spawn outside of the walls and they gradually go into the area enclosed by the walls and out the other wall (blue). I want to mask whenever a part of the enemy is outside of the wall boundaries (green). Is there a simple way to do this? It's easy to do in 2d but the enemies and wall are 3d.

hushed silo
#

Hi! There are lots of usable and easy solutions for portals in URP, I’m having trouble finding “the” solution for built in rp. Can anyone point me in the right direction? Thanks!

amber saffron
# hushed silo Hi! There are lots of usable and easy solutions for portals in URP, I’m having t...

Experimenting with portals, for science.

The project is available here: https://github.com/SebLague/Portals/tree/master
If you'd like to get early access to new projects, or simply want to support me in creating more videos, please visit https://www.patreon.com/SebastianLague

Resources I used:
http://tomhulton.blogspot.com/2015/08/portal-rende...

▶ Play video
GitHub

Portals in Unity. Contribute to SebLague/Portals development by creating an account on GitHub.

silk sky
#

Does exist a way to not save material changes in Play mode?
I need to rotate the skybox while keep it at the same initial position on scene restart
(please dont suggest to store the rotation value,I hope there's a better way)

amber saffron
silk sky
amber saffron
#

Yep. In theory, when you reload the scene, it should again use the original material that was not changed, and the instanced one goes to garbage collection when unloading.

silk sky
#

so how do I create a copy of the skybox?

amber saffron
#

var newMat = Instantiate(skyboxMat);

silk sky
#

is this wrong?

amber saffron
#

Yes, tempSkybox still points to the original material. The Material type is a class, not a struct, so it is passed by reference, not by copy

silk sky
amber saffron
hexed matrix
#

Hi! How do I pass custom attributes to the shader graph from the VFX graph?

#

To clarify, I need to read them in the vertex context of the shader graph.

low lichen
#

I'm not entirely sure what it's actually doing, whether it's passed as an instanced property or what, but it worked for me.

hexed matrix
mighty peak
#

Heyo 🙂 I'm struggling a bit with stencil shaders, and I was wondering if someone would be able to identify where I'm making a misstep:

Essentially, what I'm trying to achieve is just that the green cube will only be visible when within the silhouette of the red sphere. However, the green cube is currently rendered no matter what, as seen in the GIF.

The following is my shader code:

Green Cube
Shader "Green" { SubShader { Tags { "RenderType"="Opaque" "Queue"="Geometry"} Pass { Stencil { Ref 3 Comp always pass replace }

Red Sphere
Shader "Red" { SubShader { Tags { "RenderType"="Opaque" "Queue"="Geometry+1"} Pass { Stencil { Ref 3 Comp greater }

Big thanks if anyone is able to identify the issue 🙂 I've been banging my head on this for a while, haha

low lichen
regal stag
mighty peak
#

Thank you both 😊

It definitely helped with the silhouette issue 🙂 Now the only remaining goal would be for it to keep rendering the green as long as it's within the silhouette of the red, regardless of it being occluded by red.

I'm thankful for the help already, but I'm also all ears if anyone has any pointers to the remaining issue 😊

low lichen
#

That goes inside SubShader or Pass, not Stencil.

mighty peak
mighty peak
#

Whoops, using "ztest always" seems to have the side effect that the mask will now appear in fron of any object at all, does anyone know a way to bypass this? 🤔

neat hamlet
#

ztest greater and higher renderqueue than red on green

mighty peak
quick scaffold
#

hi! how do i make a billboard quad to use in my shader?

warped violet
#

Hi everyone. I've been creating mods for a certain game for some time now, and recently I've started a project of recovering the original unity source of the game in order to make literally any mod possible. It's been going flawlessly, apart from one issue. The shaders. No decompiler I've found can properly export the shaders, all of them get a parsing/syntax error and because this was made in Unity 5 (and is transferred to Unity 2017 as U5 is way too unreliable) I don't think there's any visual aid. My only choice really is to figure stuff out from the script and I have no idea where to begin.

#

"Parse error: syntax error, unexpected TVAL_ID, expecting TOK_SETTEXTURE or '}'"
this is one of the most used ones which accounts for like 90% of the materials. A solution to it would probably help with everything else

regal stag
hardy flame
#

I don't know what this is saying

simple galleon
#

Hi, I applied two materials in one mesh. One is the ToonShader material and the other is the Dissolve material. Now I want the Dissolve material to act as a mask. So, I want to make sure that only the parts of ToonShader material that overlap with the display part of the Dissolve material are displayed. Is there a way?

tropic field
#

In Shader graph, does the Object Node > Scale output return an absolute value??? I tried getting the sign of scale.x but it is never -ve

#

I tried the test also by checking if scale is less than 0 but the comparison node outputs black

#

Even though in the inspector the scale is clearly -ve

ocean agate
#

Is there any way I can delete some built-in shaders that live on my shader list without any purpose (for myself at least), such as VR, Mobile and also the Standard one that lives there even though my project can't use because it is URP? sadge

#

If anyone tell me how I'll heavily appreciate it

#

searched and nope you can't, leaving the messages here if anyone ever had the doubt lol

summer path
#

why is this happening with my shader

#

this is the setting for the 1st one btw

#

i haven't changed anything, and it used to work just fine

#

it's just I've been using a new sprite sheet

vocal narwhal
summer path
#

it's weird cause if i move it around a bit it unbreaks

vocal narwhal
#

I am not sure; the SpriteRenderer sets the texture via a material property block; and presumably touching the material directly removes that until the sprite renderer updates again

summer path
#

whats also strange is

#

it doesnt break with the other colors

#

only the body color

#

acttuallyy i think thats just because the body parts are separate

#

wellp um

vocal narwhal
#

Is it the body that you currently have selected?

summer path
#

mhm

vocal narwhal
#

Try just deselecting it and then modifying the material

summer path
#

how would I do that without selecting it?

#

oh wait nvm

#

yeah it doesnt break when i go directly from the material itsef

#

but why would it suddenly break when it worked before

#

and colors will change at runtime so i hope this doesn't happen then

summer path
#

found the issue btw, i never changed the actual material's texture so it was still the old spritesheet

fathom cobalt
#

Hello ! I'm really struggling to make this work. What i want the shader to do is to color my terrain, white for the peaks, green for the flat areas and gray for the steep areas. It returns a pink material tho. I'm using HDRP and the terrain is a mesh .

grizzled bolt
fathom cobalt
grizzled bolt
compact reef
#

what would be the most performant way to change tiling/offset of a material?

#

using script?

#

or to define into the shader itself? though it would be complex because i need that same shader in some case where tiling/offset needed constant

compact reef
broken maple
#

Does anyone know how to make a shader in URP that makes an object not receive shadows from a certain object layer?

tardy spire
#

Anyone familiar with projection mapping/matrix math that could lend me a hand?

I'm rendering a scene from a primary camera (the "View") into a render texture, and want to reproject that render from the perspective of another camera (the "Projector") onto a surface.

To do this reprojection, I've made a shader that uses the View camera's projection matrix to sample the render texture. This custom material is used on the models that I want to use as the projection surface. I figure this should work, but I must missing something because it does not line up. I've attached the shadergraph source and a screensot, as well as what both cameras look like. This is the C# math that calculates the Projector Matrix:

_surfaceProjectionMaterialInstance.SetMatrix
(
    projectorMatrixProperty,
    projectorCamera.projectionMatrix * projectorCamera.worldToCameraMatrix
);
tardy spire
#

welp. i believe it's fixed. i was being dumb and getting the projector matrix from the projector instead of the view

devout spoke
#

Is the Bounds Size object rotation independent? Or will it also "rotate" with the object?

quick scaffold
grizzled bolt
quick scaffold
#

i never did a custom transparent material before

#

do you have any sugestion on how to do it right?

grizzled bolt
low lichen
eternal rampart
#

Hey, not sure if this is the right channel to ask this but I'll give it a shot.

I'm making a bloxorz game where when you go down the goal tile, the player goes invisible. I managed to make this work by giving the the block underneath the tile a VR/SpatialMapping/Occlusion material.

However this doesnt work when I want to add a background image using the UI/image object because its just ignoring the image entirely and just showing what it would look like without a background

#

also the block is only invisible when I use solid color for the camera's clear flag component

devout spoke
crude flume
#

hey i was wondering if there might be a way to turn a shader graph into a standard shader? i ask this because i have bought a prefab that uses shader graph for its material (even though it has the main options for mainly standard, photo included). Normally i would swap it to be a standard shader. however when i do this all the textures dont get properly placed in the standard shader. All that i know is that this is cause the naming convention is different so it wont carry over nad place it properly.

Things like _MainText is instead _Base_Map in the shader graph shader. (ive tried editing the shader and it either doesnt work or it makes the textures vanish)

Anyone know a way to swap it and carry over to standard or something. cause theres 100+materials in the package and like 5 textures each and i really dont wanna go through by hand going back and forth redoing them all x.x

tranquil cipher
#

In a shader, we have to sample a texture 2D LOD to displace the vertex position (tess/vertex animation), and have to sample texture 2D again for the sample texture to use that for color right?
Have to sample the same texture twice.
Is there anyway I can go around with sample only once?

tranquil cipher
amber saffron
tranquil cipher
#

if I want to make a environment shader with those features, antitile + triplanar + displace, that support 3 textures blending, that would be 14x3= 28 samples.
How can one do this?

crude flume
compact reef
tranquil cipher
amber saffron
amber saffron
# compact reef is that the most performant way?

Texture size and offset is stored in a vector 4, if you wanted to be even more "performant", you could use a SetVector function instead of the two others. But I doubt that this is something that will make you application go from 30 to 60 fps ...

#

@tranquil cipher And we're talking of a single texture here, if you want to have albedo + mask map + normal ....

tranquil cipher
crude flume
compact reef
tacit parcel
amber saffron
#

But I'm volontarly exagerating things here, this is the really worst case scenario where a single pixel (or more, wavefront) would have the worst blending case where everything needs to be displayed.
In reallity, there will be way less overall.

tranquil cipher
amber saffron
#

And you could look into some more performant methods, like biplanar sampling instead of triplanar

amber saffron
compact reef
#

okay

#

cool

quick scaffold
quick scaffold
#

this and others btw

#

i think is something related to GPU instancing

#

but idk what exacly

grizzled bolt
quick scaffold
#

just the default unity unlit

#

opaque rendertype

#

oh

#

i found the solution on the documentation

#

thank you anyway @grizzled bolt !

#

Now i need to make it transparent xD

grizzled bolt
quick scaffold
quick scaffold
#

is there anything like mesh ID?

low lichen
junior copper
#

hello

do you guys have any starting point(s) or nodes to recommend using so i could change the color of a shader depending of where the player is

the idea of the end result is "painting" the floor where the player is, and fading back to init color when he move somewhere else

#

maybe getting the player world XZ, and "drawing" a circle with the center equal to the world XY

grizzled bolt
quick scaffold
#

instead i think i need to use something like MaterialPropertyBlock

low lichen
low lichen
quick scaffold
#

the only problem with this is the fact that i am not doing it for every single mesh

#

but in packs of 1000

#

can i do the single material with diferent colors in one draw?

junior copper
#

is there a way to display numbers in the shader graph ? for better debugging
for example i have a position node and i would like to know what it shows for a specific mesh

quick scaffold
junior copper
#

ok ty

quick scaffold
#

is there any way of taking the world position of a vertice?

amber saffron
quick scaffold
#

i'm doing it in custom shader

amber saffron
low lichen
junior copper
junior copper
# amber saffron In shadergraph ? There is the "position" node

regarding the position node, i tried the last 2h in a shader graph to take as a input a vector2 and draw a ellipse with this vector as the center point

the only thing that worked was when doing something "locally" from the 3d object (plane) origin point, but i would like to be world.
for example, i give 100,50 wolrd coords and (lets say the plane takes all the scene) a ellipse is draw there with 100,50 as the center

amber saffron
junior copper
#

yes ofc

#

tried bunch of combination and math, but im new to how UV and Unity shader graph works

junior copper
#

thank you so much for your time it works perfectly

#

i guess i didnt test the combination of using xz and subtract

amber saffron
#

In Unity a default plane is on the X and Z axes, that why I used the swizzle node to "isolate" those for the input of the elipse.
The elipse node does draw an elipse centered on the origin of the "UV" that you input.
Subtracting the value you wanted to the world XZ did offset the origin, and allows to draw the elipse at the desired position.

junior copper
#

i remember trying stuff with Z but nothing outputted, only with X and Y
i dont remember what i did exactly

ancient veldt
#

How can I create a 3d mask gameobject to hide the gate's opened parts?

quick scaffold
#

chunks 😎

junior copper
#

i tried using sphere mask to make a ellipse fading but i didnt manage to make it work
is there another way ? or what could i be missing ?

junior copper
#

Can you "cache" a result in the shader graph and reuse it somewhere else in the same graph ?
so i dont have lines crossing my entire graph because i am reusing some same output

broken sinew
#

Is there a performant way to write a multipass shader with a write+read buffer between the passes? For context: I wonder about implementing cone tracing, where you render the screen with multiple passes at increasing resolutions starting from 1x1* (conceptually, irl with something like resolution/16) and start with depth buffer to cache the SDF distance between passes. Is there any official way to do it in shaderlab alone in unity or do I have to implement something like that using command buffers? https://forum.unity.com/threads/multi-pass-shader-that-uses-texture-between-passes.561025/

what about URP?

frail violet
#

with shadergraph (i'm using builtIn pipeline if it matters), whats the easiest or best way to support GPU Instancing?

quick scaffold
#

hi! do you guys have any material sugestion for studying geometry shaders? i need to create a quad but it's kinda harder than i first thought

rugged relic
#

anyone have any sources or specific things i should research to make a shader like this? (Game is called Buckshot Roulette)

quick scaffold
#

I'm using cloud points technique to make a ton of grass in unity, is there any way i can pass custom info that isn't normals/uvs etc to my mesh?

#

for instance if i want every vertice to have a number given by a perlin noise

thick willow
#

small question, shader noob here.

i'd like to create a shader that acts sort of like a mask and applies distortion to everything behind it.
what would be the basic approach towards something like this?

(for example, a 3D Sphere with that Material/Shader should be invisible, but everything that it's occluding should suffer distortion)

grizzled bolt
rugged relic
#

omg a posturize effect is like exactly what i was looking for tysm

old saffron
#

Can someone help me with a shadergraph that skews objects towards the camera at all angles? I can skew it in 2 directions, but not able to stack it to be seen in all angles.

astral mason
#

How do I make Shader Graph VR compatible?\

compact reef
#

im using a fragment shader that supports a single texture and baked lightmap.

now which one seems the best method for performance? picture 1 ? or picture 2? or both are same?

prime shale
#

honestly they both look about the same

#

one way to check if you are actually reducing the amount of instructions and such

#

is to view the compiled shader

#

compare them instruction wise

full void
#

any idea why when in the sample "terminal scene" when I walk into some of the rooms it keeps showing this compiling shader all the time as I move? it keeps popping up basically all the time when I enter the room, finishing in 1-2s and reappearing maybe 0.5s after

#

in the other sample scenes it compiled the shaders fine without showing a popup, just doing it while the game runs

compact reef
compact reef
prime shale
#

no

#

shadow caster pass has to be seperate

compact reef
#

i see, though it will cost only 1 set pass call, but i was afraid of having several materials on that same shader

compact reef
prime shale
compact reef
#

sure

prime shale
#

because in theory if your project does not use any realtime shadow casting, or uses camera depth to do any effects you don't need a shadow caster pass at all in any of your shaders

#

and sure using a fallback will keep your shader code small, but it wont make it run any faster or make it any better on that front

compact reef
prime shale
#

I know I mentioned this before though I forget if you responded to it, but I would only worry about optimizations if you start hitting performance problems in your project when deploying and testing on mobile

compact reef
#

yeah, you told it before, first to sum up all the things and then optimizing... But I was actually targeting from low end devices, that's why i was aware on every steps

#

I had another question, is it possible to have realtime point/spot light supported on the fragment shader while being lightmapped at the same time?

prime shale
#

yes

compact reef
#

It needs one extra pass? right?

prime shale
#

that pass only gets used and added to the setpass calls if in the engine shadowcasting is used, or if you are using the camera depth texture

prime shale
#

if for example the only realtime light you'll have is a point light/spot light I think you can use them in the forward base pass

#

and keep it all in that one pass

#

but if you are using a directional light, and another point light at the same time, you need another pass

#

ForwardAdd

compact reef
#

Yeah, According to the condition, im gonna need forward base, because i wont need directional light anymore after baking out the scene

compact reef
compact reef
ionic python
#

Is there a way to get ShaderGraph's Scene Color working in URP?

#

Currently, anything I try to do with it, it just returns black

#

I'm trying to create a shockwave effect, and every tutorial I checked used that

#

but for some reason it just doesn't give the same output as it does in tutorials.

junior copper
#

how can i make all faces show the same output i am giving ? (the 45d rotation on first screen)
also, is there a way to make the position node ignore the scale (so the lines dont stretch when scaling up)?

grizzled bolt
ionic python
#

oh wait hold on

ionic python
#

its just transparent now

#

(with only scene color)

#

messing around a bit, I created a black hole singularity

#

it started rendering things behind it

#

but I can't get it to do the pulsing effect

regal stag
# ionic python its just transparent now

That's kinda the point. The scene color returns the colour of opaque objects (& skybox) behind it. If you don't alter the input coordinates, it'll appear as if it was invisible.

ionic python
#

and it did that

regal stag
#

Is the graph set to Transparent under the graph settings? That is required for scene color to function correctly

ionic python
#

but it doesnt do anything

ionic python
#

this is all I get in gameview though

#

it works fine in the preview too

#

but not in game

#

@regal stag any ideas?

regal stag
# ionic python the preview is good

Am confused, you were using Scene Color above but now are using Sample Texture 2D? You'd typically only use MainTex in a sprite shader or fullscreen/blit effect.

ionic python
#

and yes I started using Sample Texture2D too

#

the sphere works

#

the circle doesnt

#

@regal stag how could I make the "black" parts transparent?

#

because otherwise it almost works

regal stag
#

Maybe Saturate first to make sure the black parts are 0 and not negative values

ionic python
#

i swear this'd be easier in code

regal stag
#

I'd check your graph against tutorials using scene color. You need to be adjusting the UV input, not it's output. e.g. For distortions you typically do something like Screen Position + ShockwaveUV + OptionalNoiseTexture -> Scene Color -> Base Color (master stack)

ionic python
#

im getting weird artefacting

#

hold up

regal stag
#

Yep that looks better

ionic python
#

so a shockwave for objects, not as an actual effect

#

there are some issues though

#

they become pixelated, that weapon just completely disappears

#

it only seems to be able to affect opaque materials

#

changing downsampling fixes the quality

ionic python
regal stag
ionic python
#

tf am i meant to do then

#

but I have no idea how to

#

i thought maybe a cool shockwave would do it

#

but that wouldn't work because most of the projectiles are transparent to a degree

ebon basin
#

welcome to what I've been researching the past few weeks

ionic python
#

and the shockwave would just make them completely invisible

regal stag
#

You could also change the Render Queue on the shockwave materials (or Sorting Queue) so other transparents always render ontop. They wouldn't be distorted but would keep rendering at least

ebon basin
#

over-use of transparents is quite problematic

ionic python
#

but yeah

#

maybe do you have any ideas on overall creating an effect for it?

ebon basin
#

keep your projectiles opaque or use additive blending

#

I assume this is because the shockwave is creating problems with the other transparent projectiles?

ionic python
#

but i think i just wont use a shockwave here overall

#

I'll use it somewhere else where it won't be trouble

regal stag
ionic python
#

thank you for the help though!

#

the problem is that shields are really not mainstream when it comes to combat

#

so it hard to look up stuff for them

ebon basin
#

alpha clipping and opaque has been a good alternative for my systems

ionic python
#

because games rarely use them

ionic python
azure geyser
#

Is there a text editor that will highlight syntax errors for ShaderLab shaders?

ionic python
junior copper
#

so i am doing some testing with a fullscreen shader
my goal is to do a fish eye effect

how can i "get" the screen colors and use it in the "spherize" ?

#

or is there a another way

regal stag
#

Though I think the URP post processing volumes might also already have a fish eye warping effect too

junior copper
#

i am in hdrp :/

#

there is HD Sample Buffer

regal stag
#

Ah I don't know anything about HDRP. Maybe check the post processing effects though first. There might already be one

ionic python
#

how could I create a trail for a cylinder type object?

#

tutorials only talk about point trails or sword trails

#

I'd kinda want to have this shield's outer edges kind of create a trail somehow

grizzled bolt
#

@junior copper try HDRP's panini projection or lens distortion overrides

junior copper
#

"limited" settings

junior copper
ionic python
#

I was thinking perhaps having a simple 2D circle

#

and that circle, when it's being moved, it creates a trail on its edges

meager pelican
# ionic python anyone?

Why not just use a particle emitter, matching the size of the emitter and some emitter normal direction to the shield's edges, emitting particles? If that doesn't work, I guess you could create an array of previous-frame positions with a center and normal and then do some effect with it, but you'd have to have a mesh or a full screen pass (which is basically a quad mesh the size of the screen) to draw into. I mean, something has to make it to rasterization.

ionic python
#

I was thinking of getting a circle that matches the size of the shield yes

hollow wolf
ionic python
#

and not just on the edges?

hollow wolf
#

well you can play with the lifetime and the velocity

ionic python
hollow wolf
#

as you can see, all the particle is right in the edge of the circle

#

just play with the radius and Rad thickness value

ionic python
#

thank you!

ionic python
hollow wolf
#

default particle system

#

i mean sure you can use VFX, but i belive particle system is already enough

ionic python
#

oh yeah that one has a built in circle emission

#

also what about making something flash?

#

kind of like a pulse?

ebon basin
#

you can do a point cache with vfx graph if you want trails

hollow wolf
limpid heart
#

Hey, not sure if this is the correct channel to ask in. but i had a question on importing fbx's and materials/textures

limpid heart
meager pelican
# junior copper any ideas ?

You could try the triplanar mapping node, and use worldspace as a tiling system. Or maybe you want some kind of scaled object space or view space, with tiling node, not sure from your description.
https://www.youtube.com/watch?v=HKTIuvFHAPQ

To use the scale of an object in shader graph we need to modify UV values that we pass to the rest of our shader. In this video I will show you how to use Object node and Tiling and Offset node to do just that.

@Jettelly
Learn all there is about shaders in Unity
https://learn.jettelly.com/unity-shader-bible/

Learn to write more maintainable...

▶ Play video
junior copper
#

scale fixed, now the rotation :')

meager pelican
# junior copper scale fixed, now the rotation :')

How is rotation impacting your uv mapping on a quad? What do you want to happen?
The triplanar will map "to the outside world" as if a projector is projecting the pattern onto the object from the outside, in three directions.
But it may look a bit odd as things rotate. OTOH, you can map to the object itself, in which case the object's rotation shouldn't matter, but scale will.
So without more information as to what you want to see, I'm not sure what to tell you.

low wedge
#

Have a shader graph prolem right now when i use my material with my shader in the particle system, the problem is that if i change my color, my alpha changes, so if its all white the alpha is visible and if its all black its invisible even though im not moving the alpha slider

grizzled bolt
low wedge
#

where do i set the blend mode? Im new to unity

junior copper
#

in graph settings

low wedge
#

Ok, yes the blend mode is additive

grizzled bolt
low wedge
#

Even tried splitting every single texture/color and combined only the rgb values but id didnt work