#archived-shaders

1 messages Β· Page 106 of 1

ebon basin
#

It'll try to batch different material instances as best as it can

stone mantle
#

ic, ty for the help owo_heart

stiff tapir
#

You'll have to excuse me if I'm asking really beginner level questions. I know GLSL, so HLSL features are pretty foreign to me.

#

For a surface shader, what is uv_MainTex variable in the Input struct exactly? obviously you can use it in the tex2d function to map a texture to your UVs, but I don't understand what it is I'm feeding it. uv_MainTex has to share a name with a texture, and I don't get why. What is it representing by declaring a variable that has my UVs coupled to a Texture's name?

#

I'm really expecting it to be the UV coordinate for this screen pixel, but I've tried making a color as (uv_MainTex.x, uv_MainTex.y, 0), and it doesn't work at all the expected way

regal stag
#

In vert/frag style shaders the equivalent is something like TRANSFORM_TEX(IN.uv0, _MainTex_ST) (or IN.uv0 * _MainTex_ST.xy + _MainTex_ST.zw)

stiff tapir
#

Mm, okay, so it's coupled to the texture because the texture is transforming UVs under the hood

unkempt flame
#

okay another thing so Im trying to make plane animated by a vertex shader (a sort of wave simulation) and I have impleted a basic diffuse, specular and ambient lightingShader but I can barely see the shadows and I have no idea how to make them more pronounced ive once again tried a bunch of things this is how it looks curently

#

this just looks so blegh at the moment and I have no idea how to improve the visuals further as I feel my foundations are kind of rough

regal stag
unkempt flame
#

ive already done that and read this like 5000 times in the last 24 hours :DDDDDDD

unkempt flame
#

I also spent 3 hours making sure this is the case so im like 99.9999999% sure

#

because the normals were fucked before hand

#

heres a better view to get the idea

unkempt flame
#

this is the lighting part of my shader what the first part I should improve?

quaint grotto
#

im setting a texture2d with negative values but when i apply and sample the values become positive, is there no way to pass a texture 2d to a shader that keeps the negative numbers? I need to use -1 to represent clip

tacit parcel
quaint grotto
#

oh 😦 lame

sand fulcrum
#

Or a second texture with only the negative values, encoded fro 0-1 and then subtracted from 0

regal stag
halcyon needle
#

Hello!, im trying to make a shader to change colors of a sprite and in the shader itself it looks like its doing the correct thing, but when i go in game preview

#

it looks like this

#

what is the reason?

#

i have universalrenderpipelineasset_2d, i created a material on the enemy with the shader graph and i created a script to change the colors, and it does that

#

this is how it looks without that material

regal stag
halcyon needle
#

on the preview on the shader it looks perfect

regal stag
halcyon needle
regal stag
#

Yeah, is it still cut off in scene?

halcyon needle
#

even in the prefab

regal stag
#

Strange, can't think of why it would do that since you aren't offsetting UVs

halcyon needle
#

but thanks, already fixed the transparency, probably i messed up something elsewhere idk

regal stag
halcyon needle
#

πŸ₯°

quaint grotto
#

how are we suppose to do per object material editing in editor when it wont let us use anything but shared material

#

using a mat instance gives warnings of leaks

grizzled bolt
quaint grotto
#

applying different properties to the material on a per object basis in editor

#

when i get the mat doing renderer.material it throws up warnings in console

grizzled bolt
#

Conceptually that's the same as creating new material assets
There's no different properties without a separate material

quaint grotto
#

yes and in unity you get warnings if you create new materials in editor

#

thats the problem

grizzled bolt
#

If you create a new Material and ensure it gets destroyed from memory when not needed there should not be warnings

quaint grotto
#

oh so manually create them rather than grab it from renderer?

grizzled bolt
#

Modifying a material's properties directly is a shorthand for the very same new Material but it conceals what's actually happening
Hence the warning I think

quaint grotto
#

you mean material property blocks? isnt that for run time only?

grizzled bolt
#

No

#

Modifying a render's material instantiates a copy and modifies that, same as new Material as mentioned

#

But it's not stored anywhere except memory
At runtime it's pretty clear when instantiated objects get cleared
But in editor not so
I'm not familiar with that side but I assume there's some procedures where and how you should save temporary data with editor tools, so they neither leak nor get destroyed prematurely

#

In this case I'd guess you want to create new material assets
Otherwise I assume they'll only exist for that editor session, or maybe until you switch scenes in editor

quaint grotto
#

hm so manual clean up needed

normal dune
#

hey all, we are using ASE and have an issue with the indirect specular light node. in edit mode looks great - we use it for some simple reflections on water. when we hit play it seems like it starts returning incorrectly and the water becomes an opaque non reflective plane

strange prairie
#

Do we have a link? !amplify

#

Nope

normal dune
#

ahha I found it - didnt originally will try

junior copper
#

im unable to edit a shader graph variable on a Image material

#

i tried various things like image.material.SetFloat and image.materialForRendering.SetFloat

strange prairie
junior copper
#

well i see the property changing on the material, but visually the image is the same

#

if not in play mode it works fine when i change it manually

strange prairie
junior copper
#

between 0 and 1

strange prairie
#

Can you set the original to 0.01

junior copper
#

it starts at 1 and goes down

#

but whatever value i use it stucks there

strange prairie
#

So I'm thinking you might have different shader variants for different values here.

junior copper
#

from my shader i made one variant, and i applied it on the image

strange prairie
junior copper
#

i mean i have another shader with its variant and i can edit its property fine

#

here you can see it with a value of 0.5 (its the left & right borders)

code:

protected readonly int progressHandle = Shader.PropertyToID("_Progress456");


 protected IEnumerator ClosingCoroutine()
        {
            float elapsedTime = 0f;
            float alpha;

            while (elapsedTime < closeDuration)
            {
                elapsedTime += Time.unscaledDeltaTime;
                
                alpha = 1 - (elapsedTime / closeDuration);

                Debug.Log(alpha); // prints correct values
                SetProgress(alpha);
                
                yield return null;
            }
            
            onClosingEnd?.Invoke();
        }
#

when running the code the value is changing when i have the material selected , but nothing i can see in the viewports

brazen nimbus
#

Hello hello ! I'm looking to do a dither effect on shadow kinda like halftone style but the thing is that I'd like to have this effect only on my shadow edges and not on the whole shadow !
I followed Daniel Ilett's tut about his Halftone shader and that's kinda where I'm stuck now !
I'm in URP using unity 6 !))
Thanks in advance for your help ! 🌺

eager folio
brazen nimbus
unkempt flame
eager folio
regal niche
#

wanted to learn more about shader's and was able to come up with something simple to represent a water flow-like plane shown in the img. I was hoping to get some direction though on being able to allow objects, such as the sphere in the example, to affect the "water's animation". so something like the water sinking downward relative to the position of the sphere object, to simulate gravity for example. Any tips on nodes, layer overrides?, or how to make this work ?

kind juniper
ebon basin
#

Usually just passing in an array of vectors where objects are colliding when running through the vertex shader is the most straight forward approach, but not by any means the most optimal way considering usually you're dealing with larger bodies of water.

#

A better approach is some vector field / flow field in the format of a texture that you pass into your vertex shader

#

And with that data, for each vertex you sample the neighboring values inside of those texture and then grab some average from the weights to then modify that vert

quaint grotto
#

is it possible to get vertex colors not interpolated in pixel stage in shader graph

kind juniper
quaint grotto
#

what do you mean by vertex output attributes

kind juniper
quaint grotto
#

oh via code? not shader graph?

kind juniper
#

I guess "attributes" is not the correct word here. It's used for the vertex data inputted into the vertex shader.

kind juniper
kind juniper
#

From reading the docs a bit, it doesn't seem like you can change the interpolation method in shader graph.

junior copper
junior copper
#

okay found how to make it working, had to use IMaterialModifier, SetMaterialDirty and GetModifiedMaterial

rigid halo
#

do anyone have a good pointer to where i can read up on the URP hlsl libraries or knows what im doing wrong? i am trying to figure out how to write my own lit sprite shader in hlsl but im facing a issue with Sliced Textures, when i flip them they become invisible.

hardy juniper
#

flip as in rotate the mesh? is this just backface culling? Changing the draw side to back or both should fix that.

rigid halo
#

when i flip x in the sprite renderer it becomes invisible. could it be just that it flips the mesh? πŸ‘€

hardy juniper
#

you can check the otherside in the scene view and see! if you see nothing, enable shaded wireframe and verify the mesh exists

rigid halo
#

will try

#

it does! lmao

#

it thought it flips the uv

#

thank you!

hardy juniper
rigid halo
#

yay Stuff is showing up again properly!

glass coyote
#

HDR isn't working in my URP template

#

curious

#

for unlit that is

#

in the unlit shader graph , emission is greyed out, is this a change

regal stag
ionic goblet
#

could i replicate this shader on unity? it's from blender, i want to create a toon shader that supports vertex colors

grizzled bolt
limber pebble
#

How can I access the full world-space bounds of a mesh (i.e., the bounding box, including position, rotation, and scale) directly within a shader?
Built in

thick willow
#

help, im new to shaders, I deleted the library foulder off of my project, and when I open my project suddently it doesnt know what a shader is anymore, all my graphs doesnt work and unity doesnt even know how to open those graphs, urp seems installed in the package manager and so is shadergraph and all idk whats going on,

also I remember doing that already being fine but im not sure

kind juniper
shrewd perch
#

Does anyone know why is it pink for me?

#

I want to make reflective material but its just pink

strange prairie
shrewd perch
strange prairie
hardy juniper
shrewd perch
#

ok it works thanks

thick willow
kind juniper
thick willow
#

ok

thick willow
humble geyser
#

my fullscreen shader graph is only affecting half of the screen (one triangle?) I'm using the HD scene color node with some noisy UVs

quaint grotto
#

if any one has done texture atlas for a 2D grid where tiles can have different textures.. is it more performant to update a grid map to read what texture is at a given x:y or is it more performant to encode that data into the extra uv channels in the mesh object ?

plain urchin
#

Hi. I'm using 3D lights on 2d sprite renderer
The resulting lit part is not so... pixel-y. Is there a way for the lit part to be applied on whole pixels (of the texture) instead of the fragment screen pixel?

stray orbit
mint raft
#

guys, I've created outline for my 2d monsters.

  1. is there any way to show the outline only when it's blocked by something?
  2. can I render this specific nodes for outlineLayer, so other camera will render it?
toxic peak
#

Hey everyone.
Could someone point me in the right direction to making vertices of one object 'bend around' the geometry of another through shaders?
The particular case-use would be... vertices of the water plane dipping under the hull of the boat wherever the boat moves across this plane. It's an approach that was used for AC: Black Flag as pointed out in here: https://www.youtube.com/watch?v=euQw6IYe6Nw
I wonder if anyone ever did something similar or came across an approach like this, not necessarily revolving around ships and water? Or maybe someone has at least a vague idea on how this could be implemented in Unity?

quaint grotto
#

how can i use a compute buffer in shader graph if at all as an array for data instead of using a texture

#

@toxic peakthe water doesnt dip below the boat - the volume of the boat masks the water out using stencil shader

toxic peak
# quaint grotto <@257465700078059520>the water doesnt dip below the boat - the volume of the boa...

I think they used stencil approach for the smaller boats, but for the bigger - they curve the mesh, or at the very least it looks that way. Guy on the video thinks so too.
Masking the water with stencils or scene depth comparison does work, but both have their own gimmicks and limitations when the character has to go 'below' the waterline when entering the hull. It's a whole another thing. I was specifically interested in displacing vertices around a specific shape and if that can be reasonably done with shaders.

quaint grotto
#

i can guarentee they dont curve the water around the boat for the black flags and they also dont in sea of thieves

#

ive seen their tech presentations on it - they just mask it out with volume

toxic peak
#

oh, huh. okay then

quaint grotto
#

mask is very performant solution πŸ™‚

toxic peak
#

myeah, I think most of the volume stuff in Unity is reserved for HDRP though

quaint grotto
#

nah you can use volume stencil in urp too

toxic peak
#

Ive kinda have a solution already that uses sdf fields... but what do you mean by 'volume stencil'

quaint grotto
#

its a standard shader technique its not reserved for hdrp unless you are using unity's water api which is only for hdrp anyway

#

How to Use Depth Mask to Hide Water in Boats in Unity

1:06 to skip Intro
5:14 to jump to Blender Instructions

Have you been trying to figure out how to put your boats in the water, but not let the water seep in? Then this tutorial is for you!

Here is the Unity Wiki on the depth mask:
http://wiki.unity3d.com/index.php/DepthMask

Last I checked...

β–Ά Play video
toxic peak
#

as far as I was able to figure out - stencils are kinda.... uuuh... they are reliant on how your camera is placed and whatnot

#

yeah exactly that

#

I know that video

#

it works as long as your camera is above the masking shape

#

but what if you have a big boat and you have to go inside of it, and dip below and above the sloshing waterline?

#

well... there is a solution for that, you kinda 'coat' the insides of a boat in stencil mask... I've seen a guy do that for a multiplayer ship game. He inverted the normals of the masking stencil mesh

#

but if you have complex objects and different shaders working inside of the boat... I dunno. It feels to me like it can introduce some troubles down the line

#

at least that's what I fear

quaint grotto
#

well if you want an alternative. keep the water plane in fixed place around the boat so when you move the boat - the water plane moves with you... and just remove the vertices inside the boat's volume

toxic peak
#

that could also work

#

but what if your boat turns and bobs in different directions? or if it can flip over? its sideways profile will not match the hole in the water πŸ€”

quaint grotto
#

the water plane turns too you just have to turn the ocean animation with a transform matrix rather than the physical mesh

#

so once you know the waves you then apply a matrix to rotate it all

#

so if you turn your boat and water plane left the wave animation data needs to rotate right so it stays in place in world space

toxic peak
#

no I mean, uuuh... if the boat turns to the side like this

quaint grotto
#

otherwise the waves turn with you which looks odd

toxic peak
#

capsizing or whats it called

quaint grotto
#

oh like a sinking ship

toxic peak
#

ye ye

quaint grotto
#

and you're inside it

toxic peak
#

ye

quaint grotto
#

if you in ship can you see outside of the ship such as windows?

#

if no windows you could just turn the water effects off

toxic peak
#

true that, hmm

quaint grotto
#

i think stencil is the best approach though

#

when in ship any pixel that is in the ship's volume you discard the water pixel

toxic peak
#

that's the thing with stencil - it works depending on how you view these volumes

#

so it won't cut the pixels out if you're inside of the volume

#

you have to look at it from outside for it to work

quaint grotto
#

i think you can if you allow rendering both faces of the volume mesh

#

since by default it only applies the front facing faces

toxic peak
#

yeah thats true, in that case it will compare stencil against the thing even from inside

quaint grotto
#

yeah give it a try and see how it goes

toxic peak
#

oh I already did! it does work

#

Ive had a screenshot somewhere, hold on

#

the thing is, Ive used a setup that uuuh... it doesnt use a stencil material, but it uses stencil LAYER with Renderer Features. The thing is - if any object inside of the boat obscures the stencil mesh - water will render above this object, so you have to put all of these objects on the stencil layer

#

but the setup Ive used was kinda... funky. it used a specific layer order or something. I dont understand it fully, but it may mess with transparent materials if they are put inside of the boat

#

or maybe somewhere down the line I would use some kind of an effect that triggers inside of the boat - and the water will be drawn over it, and I wouldnt be able to do anything about it

#

but maybe that won't happen? I dunno

quaint grotto
#

im not sure havent gone that detailed into it

plain urchin
#

Hi all. It seems the Sprite slot in SpriteRenderer is detected as _MainTex in shader
Can i have more of these special slots/property name?
But SpriteRenderer is sealed class too..

humble geyser
stoic flint
#

anyone got idea how can i achieve first look here? mine looks lowkey garbage

#

the lighting i mean not the mesh

low lichen
# stoic flint anyone got idea how can i achieve first look here? mine looks lowkey garbage

There's two main sources of light in the reference image: the direct light from the pink sunset and the blue-ish ambient light. In reality, there is a lot of indirect lighting bouncing off the snow, which would normally be difficult to replicate without baked or real-time global illumination.

But because the sky is cloudy and one uniform color, and the entire scene is covered in snow, the overall ambient lighting ends up being very uniform and can be replicated with a simple single color ambient probe.

The main part where the light is not uniform is the occlusion in and under the tress. Screen space ambient occlusion might be enough for you. Sky occlusion would be a step further, and that can be done with APV.

stoic flint
#

nvm it had nothing to do with shaders, i was able to get it looking decent with some exr + color + indirect gi tinkering

stoic flint
#

i figured it out to be like that lol

stoic flint
#

that is not already default behavior in gi ?

low lichen
#

Yes, if you're baking the lighting, you will get sky occlusion. APV's sky occlusion is for if you want to be able to change the lighting while still maintaining correct sky occlusion.

stoic flint
#

@low lichen unrelated but have you got an idea how can we do something like this ? the bloomy snowy atmosphere? i could get a billboard for the cathedral with emission. but how to get that soft bloomy feel ?

low lichen
# stoic flint <@153952447516114944> unrelated but have you got an idea how can we do something...

This is essentially the same principle as volumetric fog. So, however you'd achieve that is how you'd get this look. There are generally two approaches for volumetric fog, analytical and voxel. Analytical is simpler, faster, but can't produce arbitrary shapes, only mathematical shapes like spheres, cones, etc. Voxel based fog is heavier, both in memory and processing and often needs to be downsampled, denoised, but can support arbitrary shapes and shadows.

stoic flint
low lichen
# stoic flint that looks like an overkill sadly

I've used this asset before with URP. I can recommend it, but it's pricey.
https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/analytical-volumetric-lighting-urp-performant-raytraced-volumetr-266586
Unity doesn't have any analytical volumetric fog built-in. HDRP's local volumetric fog is voxel based.

Add depth to your project with Analytical Volumetric Lighting [URP] - Performant Raytraced Volumetric Lights asset from Akidevcat. Find this & more VFX options on the Unity Asset Store.

#

But because it's analytical, you're limited to basic shapes like point lights, spot lights, rectangular area lights. To mimic the reference image, you'd need to manually author a point or spot light to best resemble the shape of the building.

stoic flint
#

im using BIRP also

#

it looks good though

#

afaik u cannot use standard birp materials in urp

grizzled bolt
#

For that you'd need some type of SSS or at least a smoother light ramp for directional attenuation
Not even ray tracing can really handle snow because it scatters light too much to denoise

stoic flint
#

yeah, ik. SSS is overkill for little income, a smoother ramping is probably a good idea

#

a good SSS will fix the ramping irl, but can't get good one in realtime

stoic flint
#

idk

#

not big fan of pre baking

snow forge
#

Please forgive me if I explain this badly.

I'm using Triplanar mapping to build up a terrain shader (layers based on height and 'steepness'

But I'm also using a 'floating origin' system because I want my map to be big, but I'm concerned that when I hit the threshold to move everything back to the origin the triplanar mapping will have a noticeable 'jolt' as it does.

Is there a way to give the triplanar a 'fixed' point from where to reference where it should be mapping from so that it always stays 'locked' to the object it's assigned to?

#

lol. Typical. Never mind, I just figured it out. Position Node (Object Space) into Absolute World Position input of the Triplanar Node

quick smelt
#

Hey there I'm trying to set up a retro dither full screen shader

#

Following this tutorial but even after adding a renderer and adding the material in my URP_Asset Renderer which is my default renderer There's no change at all

lethal sonnet
#

I have tried multiple different videos and none have worked the way I wanted (one of them which applied based on if an object was on a specific layer but it just didnt work while the rest only affected 1 material, however to say that). Tried to make myself, but didn't work either. How would I go about making an outline shader that works with a Mesh Renderer that has more than 1 material?

tawdry swift
#

All of a sudden I've been getting this erorr and I have no idea what could be causing it:


UnityEditor.Graphing.GraphObject:OnBeforeSerialize ()```
Does anyone know how to fix this?
devout quarry
drifting osprey
#

I found a partial fix for the contrasting color artifacting I had on my distortion + blur shader effect by setting the rendering path from "Deferred" to "Forward", however this does not solve the issue where I get upside down occluding geometry ghosting overlapping my shader. I repeatedly tried a whole slew of fixes including ChatGPT suggested fixes (+20 give or take), but none so far have helped getting rid of this ghosting. something has to be off in the Z depth buffer I have to assume but I can't pinpoint where the issue exactly sits. (Ztest has to be set to Lequal and shader render que has to be 3000 or higher). anyone has experience wit this? (project uses Unity 2022.3.29f1, built in renderer)

#

this shader is sooo close to being perfect, but the ghosting ruins it

kind juniper
drifting osprey
#

never mind, I got it! there was a slew of code that handled ZDepth falloff and soft particle factor that caused these artifacts

#

I eliminated these parts of the code and that god rid of the ghosting altogether so I'd say the issue is truly fixed now

raw cradle
#

Is there anyone here who knows about Stencil Buffer and could help me, please?

steel notch
#

What's the math for dissolving one texture by another in a shader?

civic lantern
#

Do some remapping if it needs to be animated

plain urchin
#

Hi. I'm trying to use this, but this uses 2D lights to work. In its shadergraph, the material is using Sprite Custom Lit
Is there a way to make this work with 3D lights instead?
https://github.com/NullTale/LutLight2D

#

And btw, in my case of making 2.5D (environment is 3D, characters are sprite renderers), is it possible/feasible to use both 2D and 3D lights together?

#

The error of the shadergraph shader is..
Shader error in 'Shader Graphs/LutLight': undeclared identifier 'error' at Assets/Packages/www.nulltale.lutlight2d@ce3b725afa/Runtime/Shaders/LutLight.shadergraph(753) (on d3d11)
And when viewing generated shader, there is literally a line like this

float4 _SampleTexture2D_374f3fae7d46483aa45b887bac71de36_RGBA_0_Vector4 = SAMPLE_TEXTURE2D(error.tex, error.samplerstate, error.GetTransformedUV(_Pixelated_4415aa866542411eb15650a74b21e942_Out_0_Vector2) );``` So yea, a var called error that's not declared yet. What is this and how to fix it?
lethal sonnet
manic wyvern
#

Hello Everyone.

Can someone please link me a tutorial or a source on how to apply a shader or material to the white part and not the black border on a sprite?

stoic flint
#

someone got an idea why the normal maps in unity look bad. i noticed this for almost every model i try. they don't look "dark enough" (or is it not normal problem?) here's an example for a terrain in Gaea vs in Unity

kind juniper
stoic flint
#

ik. but it is lit + it has normal.

kind juniper
#

Well, I only see albedo. No shadows or lighting at all. Normals don't do anything in such a scenario

stoic flint
#

are you a beginner ?

#

(just askin not to be rude)

kind juniper
#

No.
Now I do see a bit of shadows, but it's very weak. It's as if there's not directional light. Just ambient occlusion. I also do see bumps on the snow, but this might as well be geometry and not normals.

#

Overall, I think the comparison environment or settings are just not 1 to 1.

stoic flint
#

Well neither i am

kind juniper
#

Is that left screenshot made in unity as well(just with a different shader)?

stoic flint
#

so you can pass these type of questions. its a lit shader with normal and all. and no these bumps are not geomry

kind juniper
stoic flint
#

the bumps appear more because of less ambient light contribution

#

also ao maps cannot render such details for terrains (large scale)

#

neither can geometry.

stoic flint
grizzled bolt
kind juniper
stoic flint
#

both are realtime

#

the image on right is realtime, so no gi

stoic flint
grizzled bolt
kind juniper
#

It's not about realtime or not. It's about the render engine and it's settings.

kind juniper
stoic flint
#

both in unity yes, but the right one i do not own it (gaea)

kind juniper
stoic flint
#

yes ik

#

but its not gi

kind juniper
#

Are you comparing both in the same scene/environment?

#

Can you take a screenshot of both terrains side to side?

stoic flint
#

no i do not own the right one (it's a software based on unity)

#

it just makes heightmaps

grizzled bolt
#

The image on the left is also missing specular which as mentioned suggests you're missing a main light

stoic flint
#

the shader is non specular

grizzled bolt
#

You cannot verify whether your normal maps are working right or not if you don't have an objective testing environment

stoic flint
#

so you suggest adding specularity will make it look alike ? i doubt. it can be a step

stoic flint
#

they just do not look good (washed, barely seen, as you can see)

#

unless i reduce ambient light contribution

#

which dulls the scene

grizzled bolt
#

Most types of ambient light illuminate surfaces regardless of normal direction, so effectively washing out the relative effect of normal maps

stoic flint
#

yes ik, thats why i reduced it to see

#

the question is how do i get it to look like the one on the right

#

or what makes the right one look good ?

kind juniper
#

1 big thing is probably not having a directional light source.

grizzled bolt
#

If the material properties like specular are different, the lights and lighting environment are different, and the normal maps could have problems that's a bit too many variables to just eyeball

stoic flint
#

so what do you suggest?

#

i renderdoc it ?

#

specularity definetly makes it better, but still too far.

kind juniper
stoic flint
#

ok but i wished for a better response but i guess ill do that

#

ty

grizzled bolt
#

Seems to have a shadowcasting directional light at a steep angle, at least

kind juniper
kind juniper
stoic flint
kind juniper
livid kettle
#

How do i make it so the spriterenderer's color be the same as one of my shadergraph's variables? I tried right-click β†’ Set as Main Color but it doesnt work, it just multiplies the final output. Also, can this be done with the Flip attribute?

kind juniper
stoic flint
#

i tried stronger, just minimal effect

stoic flint
# kind juniper

sorry wrong rotation of the terrain, flipped, but same thing

kind juniper
grizzled bolt
stoic flint
#

i even thought about modifying the lighting func, to amplify shadow contribution

grizzled bolt
#

Instead of dimming down the ambient lighting? Why would that be a better option

stoic flint
#

to not dull the whole scene

kind juniper
#

Are not trying to reproduce the right screenshot?

stoic flint
#

yes

#

i am

#

ambient light changes both shadowed and non shadowed parts. i thought maybe i can amplify it (reduce) for shadowed parts only or sth

grizzled bolt
# stoic flint to not dull the whole scene

That doesn't really make sense to me
Increasing ambient light would "dull" the scene by decreasing contrast between light and shadow especially with the normal map
When you decrease ambient lighting and increase directional light to compensate, the contrast increases

stoic flint
#

yep makes sense πŸ‘

kind juniper
#

Possibly the right screenshot uses vertex displacement to create geometry from height map.

#

And it also feels like it might be using some form of GI. Whether baked or real time.

stoic flint
#

Possibly the right screenshot uses vertex displacement to create geometry from height map
this makes no sense ? heightmap already "displaces vertices" (by literally creating a mesh)

kind juniper
stoic flint
#

why would it do that when it can just bake it into heightmap, if we are talking about performance by distance tesselation it makes no sense here bc the terrain is looked up from afar

kind juniper
#

I'm simply basing off the look/shape of the shadows.
Can you recreate shadows similar to the ones on this screenshot or not?
#archived-shaders message

stoic flint
#

of course but maybe we continue later on i gotta sleep for work tomorrow. (thanks already)

grand jolt
#

I'm having a really weird issue when using material property blocks. Previously I was modifying a shader's properties directly, but I wanted to change this to modify the spriterenderer's mpb instead. I'm using the exact same values, I literally just replaced the shader's name with the mpb's name and applied the mpb, but the result is totally messed up. Do you guys have a clue as to what might be going on, before I go into details?

#

The shader is done in shader graph

steel notch
#

I'm making a water shader, and I want it to render after opaques (so the scene depth texture is available for the depth node) but before transparents.

#

A render queue value of 2500 doesn't work wih the Scene Depth node, but 2501 does.

#

Any issue with using 2501?

grizzled bolt
stoic flint
#

good morning

#

tesselation, parallax, .. seems beyond useless

#

here

#

its either a frag shader problem or a lighting problem or both

#

upon searching i found this hdrp vs birp image which kind of moves us towards the desired look. if you see, for some reason hdrp seem to have darker shadow/normal highlights. you got any idea why? or just lighting model?

grizzled bolt
grizzled bolt
stoic flint
#

sure but you didn't explain why

#

get the left img to look like right one

#

basically "what to tinker"

grizzled bolt
#

What's so special about the image on the right

stoic flint
#

nothing. it's just that i cannot reproduce it

#

currently

#

well ultimate goal is knowledge if you wanna go far

stoic flint
grizzled bolt
grizzled bolt
stoic flint
#

i tried it before birp vs hdrp, the difference is definetly not ao. also no baking used jn both, also birp was in linear as well

grizzled bolt
#

The example is a bit counterintuitive to me because HDR tonemapping and linear color space tend to flatten the colors and brightness range of the image, purposefully so post processing has more headroom to work with to bring contrast back up without losing color information, but in this case the LWRP which is less likely to have HDR or linear color space, also has flatter colors
Neither appearance is more "correct" in my opinion

stoic flint
#

i know in those images its lwrp vs hdrp, but its very close if not identical to birp vs hdrp

stoic flint
#

look at the hill from afar in the fog

grizzled bolt
#

When URP was called LWRP, BiRP was much closer to HDRP than LWRP in rendering features

#

Main difference is that BiRP always used linear light distance attenuation / falloff, while URP and HDRP always used inverse square root falloff which is physically accurate

stoic flint
#

ok so anyway. the difference in shadows cannot be tonemapping nor space right because shadows are too "selective" / coordinated to be that. i suppose its a shading difference?

grizzled bolt
#

It could even be SSAO rendering in front of the fog, really exaggerating the shadows on the distant rock

#

Which it isn't supposed to do

stoic flint
#

look at the small details. these are normals not geometry

grizzled bolt
#

Iirc LWRP only supported linear fog, while HDRP defaulted to quadratic fog, also

grizzled bolt
#

There's enough both for the shadows to be AO just from geometry

#

HDRP probably can use fragment normals with SSAO but not totally sure if it does

stoic flint
stoic flint
#

but yep i think its a shader difference ultimately rather than lighting

grizzled bolt
stoic flint
#

idk, the ao thing doesnt cut it for me

grizzled bolt
#

95% of the differences I see are lighting and post processing

tacit parcel
#

I think the different is in specularity, the HDRP has more specular than the LWRP, its mostly noticeable in the far mountain

stoic flint
#

that is actually true

#

energy conserving specularity you say?

grizzled bolt
#

That's also affected by tonemapping, same as darkness of shadows
But for all we know the material properties are different

stoic flint
tacit parcel
grizzled bolt
# stoic flint wym? could you explain a bit more

HDRP basically has to have tonemapping, and because of that it has to have post processing because tonemapping to bring the contrast back because tonemapping isn't meant to be used alone
At that step the author will determine the exposure, and the visual look with overrides like shadows, midtones and highlights
Which all affect appearance of light and shadow

#

LWRP was more of a wysiwyg thing

stoic flint
#

hmm.. interesting. but would tone mapping explain the specularity in the fog?

#

if feel like no?

#

but maybe it affects shadows

grizzled bolt
#

It partially affects both

#

But in this case there are unknown variables

#

I don't know if the comparison is meant to show off the render pipelines as closely as possible, or if it's showing just the assets and the RPs are incidentally there

#

If the material properties were tweaked, or if LWRP even had quite the same lit shader as URP does now

stoic flint
#

so to sum up, in birp, can we somehow get a closer look to that

#

adding specularity into he shader was a big step, but what else

grizzled bolt
#

I think you can get a closer look to that in BiRP, and even moreso in modern URP, and probably even in that ancient LWRP if the setup was tweaked with more care

#

Definitely ambient occlusion, screenspace or baked whichever works better
Sharper visual contrast with post processing, using curve, shadows/midtones/highlights, whichever works likewise

#

Could increase normal strength if you're into tweaking material properties
Though with PBR materials you shouldn't go wild with them to keep them physically accurate

#

If the material comes with AO maps, use them

stoic flint
#

already do most of these. except baking, im not fan of. also i use a 3d lut authored from blender, unsure if i wanna replace it by my own tone mapping

#

i tried different aos too horizon, msao, etc

#

the thing with terrains is you. cannot bake aos because they are huge

#

even 4k textures are useless

kind juniper
#

Did we confirm that both screenshota were even taken in unity and the same render pipeline?

grizzled bolt
#

It seems a bit of a pointless excercise to worry about matching a result pixel perfectly when we don't have the same assets, same RP or even the scene to verify with

#

If you're using URP or HDRP and good PBR materials, you shouldn't be worrying about the shader side of things

#

But rather focusing on learning what tools you have to work with when it comes to lighting and post processing
If you don't know how to use them well and start modifying the shaders or materials that are already physically accurate, you'll end up in a situation that you have no means to fix or troubleshoot

kind juniper
grizzled bolt
#

As long as you learn to use those tools, getting any kind of result you want becomes feasible and even easy
And then you might realise that the examples you were using before weren't really exemplary after all

#

The example could very well have baked lightmaps, since it's a very small area
But to my eye they look like screenspace, and if they were baked LWRP would likely have them too because it always supported baked AO, but not SSAO

#

Anyway, get scenes that you can actually poke at

#

Unity has many templates and samples for HDRP and URP both

#

With photorealistic PBR getting a specific look isn't as important as using all the tools, within intended paramaters

stoic flint
#

tools include what? (baking out) light rigging, material, shader, tonemapping/lutmapping and ss effects

#

is there more?

#

maybe volumetrics. useless here

kind juniper
#

For starters, understand what contributes to the lights/shadows and final image in your scenario.

raw cradle
#

It is possible to use Stencil Buffer in Shader Graphs? Using HDRP

#

In unlit or lit materials.

kind juniper
stoic flint
#

does unity unloads textures from gpu memory when all instances of a materials are inactive. or not. regardless of the answer where can i find info like this

#

i suppose not since there's no buffering right? if so, how can i tell unity to unload a material

sharp mural
#

Howdy! What's the best way to make this floor look wet, I assume with shaders?

#

Also wondering if there is like just such thing as using a transparent 'wet' texture to overlay?

#

The 'wetness' doesn't need to move

stoic flint
#

@kind juniper @grizzled bolt interesting that tinkering with the specularity color + intensity and normal map intensity made the normals actually appear blacker. much more realistic. (even more realistic than the image on the right). but looking at the terrain from afar still looks like it's not even lit/so bad. i'm kinda confused

#

at this point it became a game of trying and failing till i hit the result, which isn't what i want tbh, im not learning much. like, apparently specularity affects normals somehow ?

neat orchid
#

If you want puddles, ye, you could make a shader where you can paint the wetness (i.e. smoothbess) onto it

hardy juniper
kind juniper
drifting osprey
# kind juniper Use the frame debugger or native graphics debugging tools to see where this ghos...

I discovered another way on how artifacting is generated; adding light sources (a basic point light in this case) even when in forward rendering path does generate this artifacting. I did consult ChatGPT for possible fixes, one of which supposedly would help by rendering the shader "premultiplied alpha" which does get rid of the contrasting artifact, however, this causes another artifact where there particles get overlapping black borders. ChatGPT thinks these are artifacts caused by a alpha texture masks that have color values other than white (such as slight tinges of gray) however I've confirmed multiple times that the masking texture uses only white pixeles and opacity falloff for the alpha channel. anyone else ever had this issue with transparent unlit distortion shaders? you'd think with this being unlit, it would not be affected by lighting, yet it is here, and usually more affected the more intense and closer the lightsource is to the particle effect (p.s. yes this is a X49 night raven from ace combat 3/infinity, but I entirely modeled this aircraft myself from scratch)

#

this kinda sucks because the shader is near perfect as is right now, but that one little persisting artifacting issue is what keeps it from being the ideal and ready to use in future projects.

kind juniper
snow forge
#

Hey all,

So, still working on my terrain shader and making great progress and having a lot of fun, but I'm hitting a bit of a snag.

Is it at all possible, in Shader Graph to use Arrays for input values?

For example, I have a bunch of 'material rules' with a lot of 'repeating' textures with different rulesets (See attached file (formatted xml-ish for ease of reading) and was wondering if I could use arrays to build up the material so that it could be a bit more dynamic and remove the need to have a ridiculous amount of node trees etc.

snow forge
grizzled bolt
# stoic flint at this point it became a game of trying and failing till i hit the result, whic...

Normals affect specular lighting, not vice versa
Like I said if you want to learn realistic rendering, tweaking material properties until it "looks right" is not the way to go especially when you don't understand PBR, lighting or post processing properly yet
You should use PBR materials that you can trust already have the correct properties and tweak everything else besides the materials
Shadow darkness comes from dimming ambient light and implementing AO, but it feels you've rejected both of those points arbitrarily

snow forge
#

Okay, so I've found @regal stag 's Custom Node array stuff, and I think I've got my head around it.

In my head I would need float arrays for the following (I guess these could be Vector2s instead)

heightMin
heightMax
latitudeMin
latitudeMax
slopeMin
slopeMax

And inputs and outputs to match (matched by order that the floats and outs are defined?)

float _heightMin[10];
float _heightMax[10];
float _latitudeMin[10];
float _latitudeMax[10];
float _slopeMin[10];
float _slopeMax[10];
 
void ExampleFunction_float(out float HeightMin, out float HeightMax, out float LatitudeMin, out float LatitudeMax, out float SlopeMin, out float SlopeMax){

   for (int i=0;i<10;i++){

    HeightMin += _heightMin[10];
    HeightMax += _heightMax[10];
    LatitudeMin += _latitudeMin[10];
    LatitudeMax += _latitudeMax[10];
    SlopeMin += _slopeMin[10];
    SlopeMax += _slopeMax[10];
  }
}

Unless I'm missing something reeeeeeally obvious, and as long as I don't mess anything up 'after' this in the node 'chain' this should paint the selected texture in all of the places defined in this custom node?

#

Obviously the 10's in the loop need to be changed to i, cause I'm a spanner. lol.

snow forge
#

After a bit of brain hurtiness, here's the new (and hopfully final) custom node code.

float2 _heights[10];
float2 _latitudes[10];
float2 _slopes[10];
 
void TexturePainting_Vector4(out float2 Heights, out float2 Latitudes, out float2 Slopes)
{
    for (int i = 0; i < 10; i++)
    {
        Heights += (_heights[i]);
        Latitudes += (_latitudes[i]);
        Slopes += (_slopes[i]);
    }
}

I realised that I don't need inputs on the node as the c# fills the arrays directly.

snow forge
#

Yet more changes, cause I'm an idiot. lol.

float4 _heights[10];
float4 _latitudes[10];
float4 _slopes[10];
 
void TexturePainting_Vector4(out float2 Heights, out float2 Latitudes, out float2 Slopes)
{
    for (int i = 0; i < 10; i++)
    {
        Heights += (_heights[i]);
        Latitudes += (_latitudes[i]);
        Slopes += (_slopes[i]);
    }
}

Still not sure this is right tbh.

snow forge
#

Uuh okay, now I'm confused πŸ˜•

#
float4 _heights[10];
float4 _latitudes[10];
float4 _slopes[10];
 
void TexturePainting_Vector4_float(out float4 Heights, out float4 Latitudes, out float4 Slopes)
{
    for (int i = 0; i < 10; i++)
    {
        Heights += (_heights[i]);
        Latitudes += (_latitudes[i]);
        Slopes += (_slopes[i]);
    }
}
#

Oh wait, I think I know why. Cause I'm not running the c# lol.

snow forge
#

Dangit, nope, tis all broken and I don't understand why.

@regal stag sorry for the ping, but can you provide any insight please? 😦

regal stag
# snow forge Dangit, nope, tis all broken and I don't understand why. <@357936113983291393> ...

Might need Heights = 0; etc before the loop to initialize the variables

And to clarify, the function body uses += to sum the contents of the array, only to provide an example and likely doesn't match what you want to achieve here.
I don't think I understand the intended use-case completely, but if there's min/max values you'd probably want to pass inputs into the function and handle remapping in the code itself to produce a mask for each texture? Might even need to sample the textures in the function?

snow forge
#
loop (foreach in array?)
{
  if(minHeight > a & maxHeight < b) & (minLat < c & maxLat > d) & (minSlope < e & maxSlope > f)
  {
    this will create Texture1 and add to Texture0
  }
  Move to next Texture
}

Not sure if this makes sense, but ludicrously simple pseudo for what I'm thinking

#

Thinking about it, based on what you said about the +=, Maybe using the custom node/code to create the 'composite' (dunno if that's the right term) texture to then output, would probably be easier in the long run?

mild locust
snow forge
#

Ooooooookay, so I'm having another brain fart.

trying to setup the 'basic' parts of the terrain shader properly, and having a major brain block (long ass day lol.)

Image 1 is the 'donor' graph and image 2 is my current graph. The major change is the facility to define the minheight and maxheight values where the texture should be applied, instead of just applying the texture everywhere above the minheight. Problem is I can't for the life of me figure out what I need to plug into the SmoothStep node after the change.

snow forge
#

I give up, this is driving me insane. 😦

#

Okay, seriously, how hard can it be to use world height and min/max values to get something like this?

#

OH!! I think I've done it. lol. (sorry for all the messages, been one of those days)

snow forge
obsidian haven
#

hey, why is the texture not tiling? i've tried it with png and jpg, the only texture that tiles properly is unity's built-in default particle-_-

how do i fix it?

regal stag
rich herald
#

Hey. Anyone here familiar with the Unity Shaders Bible? I'm wondering how updated it is and if it leverages URP features in Unity 6.

strange prairie
#

It does go into URP but IMO it’s too focused on Shaderlab to be relevant. Writing HLSL for URP is still very impractical

#

So… it does have the information you need, but at least a third of the book would be impractical to use with URP.

regal niche
#

https://docs.unity3d.com/ScriptReference/Material.SetTexture.html

what does the name param refer to in here ? Value is the actual texture ur setting right ? I think im getting confused on the difference between textures and shaders, since the link references:

"_MainTex" is the main diffuse texture. This can also be accessed via mainTexture property.
"_BumpMap" is the normal map.
#

is it a string value that we can override with any name we want or does it reference something specific like normal maps (_BumpMap)? What would "_Map" be ?

nova bear
#

Unity! Hello I need to pass 18 different values per vertex so I tried to use uv channels but there are only 3 extra uv channels and two floats from uv0, so thats total 12+2 = 14

#

How can I do this?

frigid jay
hardy juniper
nova bear
frigid jay
nova bear
frigid jay
nova bear
#

wait, does shader graph support GraphicsBuffer data?

#

all I see is texture...

snow forge
#

Hey @regal stag I was thinking about the loop Custom Node again today while doing actual work and something occurred to me.

I'm inputting for example,

_heights[10]
and outputting
Heights

Would the operation inside the loop not be as simple as

Heights = _heights[i] ?

And that would spit out the value at _heights[i] or am I oversimplifying it and missing something?

regal stag
snow forge
quaint grotto
#

how can i pass a texture to my shader graph so when i sample it - i get the true value i set? i have a grid map where each pixel x:y holds an integer which represents an index in a texure array but i have suspicions its not keeping the true integer values im setting

steel notch
#

Is there a way to have a particle system inherit the color/alpha from a given texture?

#

I swear this was possible.

#

Built in, not through scripting.

#

Ah, it's in the shape module.

#

ah, this thing

kind juniper
quaint grotto
#

GraphicsFormat.R16G16B16A16_UInt

#

i need int4 per pixel essentially

#

but i think in shader graph when i sample its giving me values between 0..1

kind juniper
#

Unit might get converted to floating point. Try using a float format instead.

quaint grotto
#

how come theres no simple raw buffer option rather than textures

kind juniper
#

It's not as simple due to how graphics APIs and GPUs work. For raw data you usually use buffers.

quaint grotto
#

yeh in computer shader i can just use structured buffer but i want to use one in shader graph so i can sample the value as its just an array of data not texture in the conventional sense

#

its a pain they dont support buffers in shader graph

kind juniper
#

It might be possible if you had full control of the shader.

kind juniper
quaint grotto
#

but unless im just on old version theres no way to have a structured buffer property so you can't set the buffer in c# land

kind juniper
#

I don't think any of that changed in newer versions.

quaint grotto
#

if i want to add my buffer to my material it doesnt support a property of buffer so i dont understand how to set the buffer to my material

quaint grotto
#

yeh with material.SetBuffer right? but i need a property name but shader graph doesn't have buffer option ?

#

unless theres some weird way to do for buffers specifically

kind juniper
#

I think defining it in the custom hlsl node and using its name should work.

#

Anyways, I'd try the float format of a texture first. And if that still makes it a 0-1 range, you could do some math in the shader to get the index. For example, normalizedIndex * maxSize or something.

steel notch
#

I think Particle System bounds calculations is broken if you use Sprite shape.

sour gale
#

these are my setting to always render the outlined object in front of the outline itself

#

and this is the error I get when I build the game

#

it's like it hides everything but itself

vapid garnet
#

how do i make the shader work in unity, i'm trying to create light instance

tropic mountain
#

Does anyone know how to setup HLSL support for Visual Studio? The amount of the errors caused by my HLSL intellisense being completely lost is infuriating

#

It does recognize some of the primitive HLSL types such as float and half or keywords like struct or return because I have the HLSL tools extension installed already

#

but it breaks with anything Unity related

#

it doesn't recognize imports

kind juniper
kind juniper
#

Which is exactly what you need to setup. The path from which relative paths would be resolved.

tropic mountain
tropic mountain
#

thing is that the packages I have installed in my Unity project all have a trailing hash in their names, so the top level includes won't exactly match

tropic mountain
#

scratch that, this addon works like a charm

kind juniper
stiff violet
#

Made a complete custom stylized shader for outlines, objects and skybox

hardy juniper
# sour gale and this is the error I get when I build the game

Check if you added the shaders to always be included as mentioned in the readme (if using addressables, add them to a group).
That error implies the shader failed to compile for your target platform, is the default quality level set to what you are using in editor?

hexed matrix
# vapid garnet why is there only one

If you are modifying material parameters in code you need to reference the material through the MeshRenderer. This will give you a material instance. Otherwise the two objects are changing the original material and the second one will override the first.

sour gale
hardy juniper
sour gale
hardy juniper
#

you can use it with dev builds

#

so make a dev build for the platform and connect the frame debugger, if its on a different device have it on the same network as the editor.

sour gale
#

that's cool I didn't know that

#

the game crashes when I select the game window as the target

#

it's the same device I'm testing it on my pc

#

it happens just before ouline where it says clear (color)

hardy juniper
#

is that clearing the frame buffer? Would explain it going black πŸ€”
Check if that happens also in editor

sour gale
#

then it redraw the objcet I hovered on because I make it render after the outline to make the object display always in front of the outline

sour gale
#

but it renders the objects again after that

hardy juniper
#

can you record what actually happens? Id presume it would clear + draw the outline to some other buffer to then draw to the main frame buffer.
Id guess this step or the later draw steps are different in editor vs build

sour gale
hardy juniper
#

Yea so we can see the left list and details (share x or windows snip (WIN SHIFT S) can do recording)

sour gale
#

this is the editor just before it starts rendering the outline (the chair is an outlined object)

hardy juniper
#

okay so it renders the chair to a different render target, then it uses a blit shader to add the result to the main output

#

This sounds right so do check what the dev build is doing

sour gale
hardy juniper
#

So that shows the blit fucked up and didnt correctly combine the result. if its shader graph see if you can check what its doing.

sour gale
#

the shader also has error

hardy juniper
#

does it use a custom function node? otherwise it shouldnt have an error.
Or your unity version is too old.

sour gale
#

its 2023.2

#

this is the other shader graph

hardy juniper
#

hmm im not sure whats wrong here or why it would act differently in a build πŸ€”

sour gale
#

me too. thank you for helping anyway

stiff violet
#

under different lighting

#

skybox is also custom and changes based on sun angle, stars fade in and out based on the night time

tropic mountain
#

are the clouds meshes?

#

or are they procedurally generated

stiff violet
#

didn't spend too much time on the clouds though, I'll make them recieve more volumetric looking shadows

granite remnant
#

Hello Im new to shaders and I need some help making a Shader/Material for Lava. I already have the textures I might need. I made a scene where lava will fill most of the empty area, like a lava lake.

What I am looking for:
To have Emision where the lava is, so it makes light.
Add movement to the lava using a Panner.
It would be nice if I could add some Trigonomerty (Sin, Cos, etc) for it to have a bit of randomness in the movement (No idea if this is possible).
Use DepthFade it can be for rocks that are in the middle of the lake. (Im still trying to understand this node)

granite remnant
#

This is what I have for now. But I still would need some help so it looks cooler

pure vapor
#

i dont have a screenshot

#

but the shader will error out saying unity_ObjectToWorld is unidentified

#

despite it not only falling back to the diffuse shader, but also having imported the unitycg include

wide pulsar
#

Learning shadergraph is confusing

#

why where transparent should be is donut

pure vapor
pure vapor
kind juniper
wide pulsar
kind juniper
pure vapor
#

but i could alr guess that cuz i alr knew the custom shader was the problem

#

its in failed to compile and as said the issue is to do with unity_ObjectToWorld

kind juniper
pure vapor
#

which is weird cuz as said
falls back to diffuse + i literally imported the unitycg include

kind juniper
# pure vapor apparently it doesnt

Honestly, I don't think it is supposed to be a global variable at all. It sounds like a transformation matrix unique to an instance, so it should either be sampled from a buffer, calculated in your code or passed into the function from outside.

pure vapor
#

the tutorial says for me to replace obj2world with a custom thing

#

which im p sure SHOULD work

kind juniper
#

Then declare it in your code.πŸ€·β€β™‚οΈ

pure vapor
#

it might seem crazy

kind juniper
#

That's not a declaration

pure vapor
#

oh wait

kind juniper
#

A declaration is Type varName

pure vapor
#

i got confused lol

#

yeah ik

#

hm weird

kind juniper
#

Actually it might be a global after all. Wait a moment.

pure vapor
#

yeah its part of the cginclude

#

if im right

#

UnityCG.cginc to be specific

pure vapor
#

wrong include then damn

#

well i also imported that one (grasping at straws here) and still doesnt compile

#

this is rly weird cuz there isnt any reason the variable just shouldnt exist

#

its imported

#

but isnt there

kind juniper
#

If your code is actually how you shared it, there's a compile error before that line:

        void ConfigureProcedural()
        {
            #if defined(UNITY_PROCEDURAL_INSTANCING_ENABLED)
            float3 position = _Positions[unity_InstanceID] //<- missing semicolon
            unity_ObjectToWorld = 0.0;
            unity_ObjectToWorld._m03_m13_m23_m33 = float4(position, 1.0);
            unity_ObjectToWorld._m00_m11_m22 = _Step;
            #endif
        }
pure vapor
#

OH MY GOD

#

DUDE

kind juniper
#

Which would likely make the error sounds similar since it's gonna parse the next line together

pure vapor
#

YEAH IT WORKS NOW

#

LOL

kind juniper
#

I'd recommend using some kind of IDE

pure vapor
#

SPENT CRAZY LONG DEBUGGING JUST TO FORGET A SEMICOLON 😭

#

no i do

#

i just forgot the semicolon

kind juniper
#

I mean, an IDE should underline that part

pure vapor
#

actually i dont think i have any hlsl stuff for vs

kind juniper
#

install the hlsl tools extension

pure vapor
#

i did

#

lol thx for that

steel notch
#

Can Subgraphs have keywords?

#

Are they immediately inherited by the main graph if I bring the node in?

#

I'm trying to make a graph that uses shadows. I'm following some Unity examples but am getting an error.

#

Here is the graph.

#

It seems to be related to the Soft Shadows keyword.

steel notch
#

Seems to be complaining about this line?

kind juniper
#

Try a different name

steel notch
kind juniper
steel notch
#

I'm not getting this error on Unity 6 when I define this keyword.

steel notch
kind juniper
#

My assumption is that you're redefining an internal keyword that breaks unity shader code.

steel notch
#

I'll look at the generated shader code.

kind juniper
#

On the other hand #if keyword might error out if the keyword is not defined. I'm not 100% sure. It depends on the compiler context.

steel notch
#

Which I think are just variants for all the keyword permutations, ya?

kind juniper
#

Seems so.
Do you see #define _SHADOWS_SOFT anywhere if you do a search?

steel notch
#

Or back in Shadows.hlsl

kind juniper
#

generated code

steel notch
kind juniper
steel notch
kind juniper
#

Chat gpt seems to be saying basically what I said initially - don't use unity's built in keywords

#

These really should only be handled by the engine.

#

In fact, I'm not entirely sure what you're trying to achieve by using them there.

steel notch
#

And I assume I need this keyword to make sure that the value that comes in is correctly smoothed.

kind juniper
kind juniper
steel notch
kind juniper
#

Or rather, not bullshitting. It's correct about the keyword not defined at that point. But it assumed that it's your own code.

#

o3 give a bit more context

steel notch
#

It figured out it was Unity's implentation a bit after.

#

what is it smoking?

steel notch
kind juniper
kind juniper
#

Or was it a setting in the render pipeline asset..?πŸ€”

steel notch
#

this is my light

kind juniper
#

Then it should be on.

steel notch
#

Main light subgraph.

kind juniper
#

What makes you think that the shadows are not soft?

#

Remove the engine defines, let it compile correctly and check what it looks like.

steel notch
#

Remove soft shadows keyword

#

Remove all keywords

kind juniper
#

Oh, is it an unlit graph?

steel notch
kind juniper
#

Well, that complicates things...

steel notch
#

So lambert is just always 1.

#

But I still wanted shadows and the like.

#

So... that's why we're here.

kind juniper
steel notch
#

it just throws that error

#

on every single change

kind juniper
#

I see. Interesting

#

But I guess if it doesn't affect the functionality, you'll just have to live with it.

steel notch
#

and that's kinda bad if I want this to be my lighting model on a majority of objects

steel notch
#

πŸ€”

steel notch
kind juniper
kind juniper
# steel notch

In the keyword inspecto, what options do you have for multi compile?

#

Also, what unity version are you on?

kind juniper
steel notch
steel notch
kind juniper
kind juniper
steel notch
steel notch
#

Client issue

kind juniper
#

Honestly,I can't think of any reason to keep on using 2023

steel notch
#

Updating mid project to Unity 6 is pretty spicy.

kind juniper
kind juniper
#

Ok, 2023.2. doesn't make to much difference.

steel notch
#

One legit concern I have is that I know TMP swaps from HDR to regular color in its shaders between these 2 versions. I legit think upgrading would mess with the colors of every text element if we're not careful.

kind juniper
modest hedge
#

How can I add a flat texture to the cross-section in shadergraph so that the sphere doesn't appear hollow? (I'm using alpha clipping).

dim yoke
dim yoke
nova needle
#

If I want to have an URP shader but with some extras, I can just create a new URP shader and add the extas. However, that shader does not have all the inspector properties that I can set anymore.
Is there a way to have a template which has very similar inspector properties already, so I can still set all the things from the inspector, and then just add some extras I want?

grizzled bolt
#

It doesn't expose the lighting calculations though

stiff violet
#

Testing custom wobbly light attenuation.

tacit parcel
modest hedge
steel notch
proven stump
#

Hello everyone i'm trying to learn unity again (abandoned 2 years agoπŸ˜… ) um could somebody tell me how do I get the same texture as my blender setup.
I'm trying to put a blender scene in unity for a project but even though I can set up the material it doesn't apply like I want I looked for tutorial and they are not quite what I'm looking for.

Basically I'm trying to get the little rocks of the materials to be seen in Unity but I only get the flat brownish texture, how can I see the rocks?
I tried importing from an .fbx and .obj but it doesn't work so I recreated a material in unity, put in the albedo, roughness, normal, metallic and displacement map and I get that result in the end.

Pls help me I'm losing my mindnotlikethis

neat orchid
# proven stump Hello everyone i'm trying to learn unity again (abandoned 2 years agoπŸ˜… ) um cou...

several things here. Firstly, not the right channel but I don't blame you since there isn't one specifically or textures. Art assets workflow is probably the best.

Secondly, the texture looks stretched way to much. It's probably meant as a repeating texture and you're stretching it over a large mesh.
You need to change the tiling dramatically and see how that looks.

And thirdly, if you want actual displacement via heightmap, that's a different topic alltogether. You might need to tessellate or use a higher poly count mesh if this is just a flat plane

stiff violet
scenic shell
#

how do i flip 2d rig in 3d world without messing up the sprite renderer order of the local object

kind juniper
kind juniper
# scenic shell cuz im pretty sure it is

Shaders don't handle your rig. Unless we're talking about skinning shaders, which is probably not something we can touch in unity. At least beyond configuring settings of the rig.

Shaders just render the individual sprites. They don't even know that they are rigged to a skeleton.

scenic shell
#

yea to be precise i want to kno how to enable z depth while also taking reference of sprite renderer order in layer if it got same z pos (its in same local 2d rig)

#

is that not posible?

kind juniper
#

Not entirely sure what you mean by that. Depth should already be rendered by default.

scenic shell
#

well u see if u use sprite unlit shader theres this order in layer in sprite renderer which is global, so no matter if the game object actualy infront its still rendered in the back if it got lower order, when u change the material to unlit, it respect the zdepth however there will be some part of the sprites that are itersected on the rig

kind juniper
scenic shell
#

thats the whole problem, if i use sprite unlit it doesnt respect depth if i use unlit it got some broken intersect

#

im doing 2d rig in 3d world

#

here, an example incase im not being clear, the eye is on the higher layer order of sprite renderer, it will work fine if i use sprite unlit default, but it got some overlap here when i use unlit, as i said b4 using sprite unlit default would make appear on top of other object that are closer to camera cuz they got lower sprite renderer order in layer, however i cant just increase the other object order in layer cuz that thing is a moving object

tacit parcel
scenic shell
tacit parcel
#

something like
vertex.z += objectscale.x
you still need to figure out how to get object scale first, but iirc in urp shader graph its already exposed (accessible)

scenic shell
#

i see ill try it thx

tacit parcel
#

wait, that actually wont work as it simply offset everything

#

you need to reverse the z offset of each part, which depends of how the rig was set up

scenic shell
#

nah actualy i just made a script to give the order in layer to the shader

#

fantastic thankyou

steel notch
#

Alright I've clearly lost my mind. Here are some basic particles using the default Unity particle shader and texture.

#

I want them to be rainbow, and I want them to glow.

#

If I give them some rainbow gradient start color, they'll be rainbow.

#

If I go back to the emission region of the material, I can only tint the bloom in a specific color.

#

How do I make the boom inherit the particle color?

steel notch
scenic shell
#

not too familar with unity6 but i think the globalvolume thing might be used there

kind juniper
#

That or the effect is just baked into the texture.

#

Actually, it should be pretty easy with the latter.

steel notch
kind juniper
steel notch
kind juniper
kind juniper
scenic shell
#

why r u askin here instead of askin him how to do it tho lmao

steel notch
#

The streak is a post processing effect they made though. That's cool.

tacit parcel
tacit parcel
grizzled bolt
#

@steel notch He doesn't claim that he is using the particle color for emission

steel notch
grizzled bolt
#

Since they're separate they can have a specific emission color
But also they can be brightened by post processing or by incoming light, no emission needed

#

The vertex color * emission is fairly easy to do with shader graph

steel notch
kind juniper
strange prairie
#

HDRP does have the anamorphic bloom feature but from what I can tell it's either purely horizontal or purely vertical

#

(Almost none of these shaders are default and this is a custom version of HDRP)

grizzled bolt
strange prairie
#

Oooh

#

Awesome, you can make things look like the Star Trek movies

tranquil wolf
#

I went to a previous version control and then went forward (not trying to make changes, just trying to see the differences between something then and something now is all), and now the Unity Toon Shader plugin seems broken. I have a fair amount of shaders/materials relying on this so if I can avoid remaking them all I'd really like to. My shaders appear like the first image with the "Hidden" shader, and now Unity Toon samples have this weird "LPK/Lightmodel/Toonlightbase" - I remember it being something direct like "Unity Toon", but it no longer appears in the deop down - this LPK also has way less settings by an extreme amount so simply converting my shaders to whatever this is won't restore them either. Reinstalling package, reimporting materials, and convert materials to URP isn't working either.

tropic mountain
#

Does anyone know why my texture gets wobbly the closest it gets to the poles? Could it be floating point errors?

stiff violet
stiff violet
#

You have an equirectangular UV on your sphere, you could make a new UVmap on it that has less stretching and make a texture based on the new UVs. Basically the more stretching you have within the 2 triangles of a quad, the more wobbly they will be

normal dune
#

hey all, using unity 6, I am trying to use Shader.SetGlobalColor however it is not working - I have the variable set in my shader and set to not be exposed but nada. the value is being set to Color.red to test. Do I need to do anything else to make it work?

grizzled bolt
normal dune
grizzled bolt
normal dune
#

yeah I have been over it a few times but its not taking for some reason. will keep at it

grizzled bolt
normal dune
#

just did a sense check and debugged the value via GetGlobalColor and its correct. its only being set once, shadergraph is saved and the var is hooked up to my Base Color.

grizzled bolt
normal dune
#

yeah, something else odd (trying to debug this and I think its the same cause)

check this - circled and the values I am pointing at are exactly the same, the Vector3 is set to 10, 0, 5 in my node settings. BUT when I connect it I get different (wrong) results to if I connect the vector 3 above

#

no idea why it would

regal stag
regal stag
grizzled bolt
#

Ah, I guess "scope" replaced "exposed"

dapper heath
#

I changed my lighting to multiply the base color by the diffuse attenuation, then add the light color afterwards. which looks great (before, the point light colors would be super washed out and desaturated). but now if I add my usual white light, everything turns literally white, which would be expected given the addition I suppose

#

but I'm wondering how to capture the benefits of both

#

I'd still like the environment to be capable of being darker/black, but with the vibrancy of the added colors

#

anyone have experience with this kind of thing?

#

I guess maybe the way to do it is separate directional lighting and treat that as multiplicative, and additional lights as additive, but that sounds like a huge pain in the ass to manage and probably not that efficient, so my hope is there's a better/more wellknown solution

dim yoke
# tropic mountain How could I fix this?

One bit expensive, but mathematically "perfect" way to achieve that would be to not let the interpolation distort the UVs and instead reconstruct the UVs by using two atan2's on the x, y and z of the local coordinates of the fragment in fragment shader

smoky widget
#

What is the proper way to only include that pragma if the shader is from under unity 6?

#if UNITY_VERSION <= 6000
#pragma multi_compile PROCEDURAL_INSTANCING_ON
#endif

haughty siren
#

having trouble with this, so a lit transparent material's smoothness affects 2 things, specular lighting, and the blur amount of whatever's behind the object. is there a way to control these 2 effects independently?

#

here's some context if it helps to understand the issue, i'm trying to make a frosted ice shader, i achieve the effect seen on the left pic by adjusting the smoothness value based on depth. however when you look at it at an angle the shader leaves these high brightness edges which are really ugly, caused by the low smoothness value next to intersecting objects

#

any help appreciated πŸ™

#

i hope i was clear enough lol

tropic mountain
#

with barycentric triangle UV interpolating

stiff violet
#

you can simulate it yourself by making a quad in any 3d program, triangulating it and then squishing the vertices together and see how it looks like in the UVs

lilac mist
#

Question about materials and shaders here. If I have materials with effects built in (like enemies that can slowly turn invisible), and I try to influence those materials during runtime, I end up creating one material instance per object this material is applied to, which is bad, right?

So then what is the accepted approach for over-time effects like appearing/disappearing or disintegrating, when applied to potentially hundreds of objects over the course of a game?

#

I've seen tutorials that do these "fade in/fade out" style effects but they always gloss over this aspect and the tutorial finishes before their materials are actually put into more than one object

quaint grotto
#

if i have this for my texture array:
Shader.SetGlobalTexture("_AlbedoArray", _textures);

How do you access it in a shader graph ?

tacit parcel
grizzled bolt
#

In BiRP you'd use MaterialPropertyBlocks
Or if you have disabled / can't use SRP batching, but there's hardly ever a reason not to use it

lilac mist
#

So it's okay to create 50-100 material instances and delete them on enemy death, for example?

#

I'm in URP here

grizzled bolt
#

Should be fine
You can also pool or otherwise recycle the instances

lilac mist
#

Mm, there's a large amount of enemies at the start but they don't really respawn. I was more worried about the sheer amount of material instances

#

So I need to manually delete the material instance when I'm destroying the enemy game object?

grizzled bolt
tacit parcel
grizzled bolt
#

Changing a property from Material class directly will automatically create a new material instance, so it's not totally obvious in code whether you're dealing with an instance or not
That's why creating new materials using the new keyword as needed is generally a good idea

#

Though destroying either a gameobject or a material instance will send it to garbage collector and contribute to a hiccup later when they're cleared from memory

lilac mist
lilac mist
lilac mist
lilac mist
grizzled bolt
lilac mist
#

Will loading a new scene then automatically destroy the material instances too? I heard they essentially turn into invisible "assets", but I'm not sure what the implications of that are

grizzled bolt
#

I don't know if closing a scene will prompt garbage collection, but if not the objects will remain in memory until the next GC
Either way merely disabling objects will defer GC until a later point rather than change how they're collected

#

GC can be done manually, but that's in the realm of optimizing for GC that also includes implementing object pooling and whatnot which you won't need to do yet

grizzled bolt
lilac mist
grizzled bolt
buoyant zenith
#

Hello ! I actually need the best approach for what I have to do : basically I am creating plane polygonal meshes (which are dynamic) and I need to make repeating lines horizontally on it. The complexity about it is how to handle it with UVs interpolation and when we have curves.

Basically here is what I want : (first picture)
Black lines are the triangles and red are the markings I want to make in shader

But in reality it would look like this currently : (second picture) I just did it fastly it's probably not what it looks like in real but you get the idea.

Should I just create the repeating lines by creating quad for each or I can make it with shader and those 2 quads ?

haughty siren
haughty siren
#

can u show a vid of what you have currently?

stable sable
#

hi all

#

left one is NDAplatform Editor, right one is NDAplatform Build

#

in editor, the post process effect is transparent, so I can see an image on the edges of the screen, and in the center I can see the gameplay

#

in build, the post process effect is not transparent, so I can see an image on the edges of the screen, and in the center its brown color

#

what can be the issue?

hexed matrix
stable sable
hexed matrix
#

Good luck!

stable sable
#

or only in the build?

hexed matrix
#

I am afraid I haven't used it. Try it.

stable sable
#

I can't type it there

hexed matrix
#

Try passing in a UnityEngine.Experimental.Rendering.GraphicsFormat

stable sable
#

cannot convert from GraphicsFormat to TextureFormat

#

there's no other overloading

#

@hexed matrix I can only tell it from chatgpt, it states with 100% confidency that it supports both

#

the NDA platform

teal lynx
#

!code

echo moatBOT
grizzled bolt
dapper heath
tropic mountain
# dim yoke One bit expensive, but mathematically "perfect" way to achieve that would be to ...

Hey, so I tried implementing the solution you offered (geared towards spheres) but I've came across an issue.
Here's my code:

float3 localPos = normalize(input.positionOS); // uninterpolated object space position
 

float u = atan2(localPos.z, localPos.x) / (2.0 * PI) + 0.5;
float v = asin(localPos.y) / PI + 0.5;

if (u < 1e-1) u = 1.0; // attempted fix

float2 uv = TRANSFORM_TEX(float2(u, v), _ColorMap);
...
#

I'm getting this weird cyan seam right at the start of the UV (u = 0)

#

I'm using URP but I don't think it's really relevant here

grizzled bolt
tropic mountain
#

His statement here aged a bit, his naive answer works now with Vulkan on Unity and no longer solely with DirectX

#

but OpenGL remains an issue, the seam persists

stiff violet
#

then you won't have any triangle stretching or seam issues

tropic mountain
#

and yeah the sphere is just a testbed really

pearl glacier
#

Hey could anyone help me with this? I'm not super experienced with shaders, I just want the circle segment to continue rotating instead of terminating at the bottom like that. Is there something I could use instead of this setup or a change I could make?

grizzled bolt
pearl glacier
#

just rotating would be fine

grizzled bolt
#

And use video formats (mp4, webm) for video
Gif is not a video format

grizzled bolt
pearl glacier
#

hm I'm not sure I understand, you're saying to use a rotate uv node?

#

because I've tried that and the result isn't what I'd want

#

but maybe I'm placing it wrong

#

hm yeah I can't seem to figure out how to do that...

pearl glacier
hardy juniper
#

rotate the input UV at the start around 0.5, 0.5?

pearl glacier
#

not sure I follow

hardy juniper
#

you can rotate everything by rotating the initial UV input before passing it to "polar coordinates"

pearl glacier
#

ooooooh

#

yeah that seems to work!

#

thanks sorry it's kind of hard for me to figure out what order actually works

lilac mist
#

Can I re-use the output from the last time something was rendered in a shader?

#

Like an onion skin effect

#

For example if I could store it as a render texture in addition to outputting it to the sprite renderer

kind juniper
lilac mist
#

Essentially I'm creating a custom mesh shape which I'm rendering to a render texture, and then using that in another shader. However, I would like to access the render texture from the frame before as well, or merge the current render texture with the previous one

calm canyon
#

hi, i want to make a shader that scatters a texture on it randomly and overlappingly like this. What could be an approach for that?

#

I thought about layering tiled and offset versions of it but would like to have more randomness in there and the results were rarely as dense as the example

kind juniper
lilac mist
#

And then draw a low transparency square on top

#

Unfortuantely that is the opposite of what I need. Can I somehow make a shader remove what was already drawn to a pixel? That is, if a pixel is already drawn to, reduce the alpha of that pixel?

kind juniper
lilac mist
#

Well in this case what I wanted to do was to partially erase what was drawn to the render target before

#

So I'd be drawing two things to the render target:

  1. The run-time mesh that I'm using later
  2. Something like a full screen transparent texture that partially reduces the alpha on every pixel
#

And then I don't initialize the render texture every frame

quaint grotto
#

i created a subshader for some custom nodes and suddenly i get errors saying:
Shader error in 'Sub Graphs/Master': undeclared identifier 'WorldToLocal_half' at /(187) (on d3d11)

i have a _float version already written, why does it suddenly want a _half version ? my inputs are float precision and my subgraph is set to inherit. does my subgraph need both version declared regardless ?

#

it worked fine as a custom node until i saved it to a sub graph

stiff violet
#

set the albedo UVs as a cubemap, then set your texture as a cubemap

grizzled bolt
solar marsh
#

hey does anyone know if I can "pin" a texture to an object other then using the UV outright? right now its using object position

grizzled bolt
#

Also, with UVs you don't have to use a 3D noise/texture so it saves cost

solar marsh
#

interesting, how can I use multiple channels is it something would would have to do in blender and then import?

grizzled bolt
#

Not much continuity though, but that's ultimately not possible to get perfect (unless you project UVs and deal with repeats and mirroring instead)

low lichen
solar marsh
solar marsh
#

or does the full shader need to be written

grizzled bolt
#

It'd be as simple as sampling the 3D noise on each vertice's original position, per vertex

low lichen
# solar marsh I saw something like that, guessing that you have to get a custom hlsl node no?

You can do it with just a custom HLSL node. It's a bit tricky to read from the raw vertex buffer though, since it generally contains other attributes and where the positions are stored can change depending on what attributes the mesh has.

You have to define the buffer as ByteAddressBuffer and calculate the correct offset for where the position data for the current vertex is in the buffer, using Vertex ID, offset and stride:
https://docs.unity3d.com/ScriptReference/Mesh.GetVertexBufferStride.html
https://docs.unity3d.com/ScriptReference/Mesh.GetVertexAttributeOffset.html

#

It would look something like this:

ByteAddressBuffer _VertexBuffer;

void ReadOriginalPosition_float(int VertexID, int Offset, int Stride, out float3 Position)
{
    uint index = VertexID * Stride + Offset;
    return _VertexBuffer.Load3(index);
}
#

Where Offset and Stride are the values returned by Mesh.GetVertexBufferStride and Mesh.GetVertexAttributeOffset, passed from script to the material.

#

The nice thing about this is you don't have to enable read/write on the mesh, since you're reading the mesh directly from GPU memory.

grizzled bolt
#

I think the end result would be similar to sampling a 2D noise using projected UV coordinates of the character standing (rather than unwrapped), but with a third dimension so you don't get the stretching

inner lion
#

gradient property cant be exposed?

low lichen
#

They could make a workaround, such as generating a texture in place of the gradient, but that's more expensive to sample and means you have an additional asset to manage alongside the material.

inner lion
#

so an alternative would be to lerp between colors?

low lichen
#

If you just need two or three colors, that can work.

inner lion
#

alright, thanks

last harness
#

after updating from 6.0 to 6.1, batch mode builds (but not builds from the editor) strip all variants of some urp shadergraph decal shaders in the "scriptable stripping" phase

6.0:

...
After built-in stripping:   144
After scriptable stripping: 42

6.1:

...
After built-in stripping:   144
After scriptable stripping: 0

this of course causes the decals to fail to render in the build

how can i debug what "scriptable stripping" is doing?

tropic mountain
#

I've imported this simple curtains texture and set it as a cubemap (dunno if I did it correctly)

#

but the result seems weird

tropic mountain
#

Figured out, I was using world space position instead of world space normal...

#

thanks @stiff violet

tropic mountain
#

ghostping?

sick harness
#

Is this part of Poiyomi shaders?

last harness
# last harness after updating from 6.0 to 6.1, batch mode builds (but not builds from the edito...

figured it out, looks like when building an android player in unity 6.1 batch mode, setting "Technique = Automatic" for the Decal renderer feature causes shader stripping to be done using DBuffer as the technique, but the builds i'm making only have gles which doesn't support DBuffer decals, and as a result the shaders get stripped entirely

the workaround is as simple as just setting the technique manually to Screen Space

hidden hull
#

Hello, I need help for shader graph. I have a material with grass that uses wind, and I would like the character to be able to move the grass when he approaches/touches the grass, then the grass stops moving when he moves away. I have to use a vector3 for the character, and a float for the distance (I can use something else). I don't need to make a system to move the grass, I managed to do it but what I can't do is the system to calculate the distance and if the player is approaching. I'm using Unity's 6 visual shader graph. When the player approaches the grass, it moves a wind value, and when the player moves away, the value stops increasing. When the value doesn't move, the grass doesn't move anymore. Whatever its value.
I had already started but I gave up so I deleted what I had done

modest hedge
#

I'm using alpha clipping on the mesh and using the back faces to appear as the inside walls of the object in shader graph. However when the back faces are not visible to the camera the object appears hollow (rightfully so). How can I fix this so the object appears filled upon rotation? I tried clipping only the front faces but the then the back faces don't get clipped at all and appear outside the box as well.

toxic flume
#

My game is 2d tile base game. There are different ways to render these tiles.
One approach is to create a tile mesh for each tile
Suppose my world size is 1000 x 1000

Another way is to generate just one quad mesh and pass a structure buffer with tile id (in my game, the buffer size would be one million) and inside the frag shader, by manipulating uvs and getting tile id from the structure buffer, sample the texture atlas.

What do you think? which one is more efficient?

tropic mountain
#

Is there a way to add custom Color properties to my shader that don't take an alpha channel via Shaderlab or C#?

#

I'd like also to use this kind of handy button in my custom editor, is there any way? Can I reuse whatever that button class is?

neat orchid
#

Why does sine time work as an input into any component in the UV nodes, but Time doesn't?

grizzled bolt
snow depot
#

I've had a project with unity toon shader for a little while, and I stopped working on it for a bit. Now I've come back and there's these issues. Does anyone know what could cause that?

#

Also I've gone back to version 0.11.0 and 0.10.2 and it doesn't work so I don't think it's due to my unity editor being out of date

wind tundra
#

is there a way to temporaily disable a shader graph?

kind juniper
wind tundra
#

i see, ty

hardy juniper
neat orchid
#

sine time works there no prob

#

as for the editor increasing the value, I thought of that but I should reset when I enter play mode and it doesn't seem to

grizzled bolt
neat orchid
grizzled bolt
neat orchid
#

I meant increase it with time and clamp it at a value I want to be max

grizzled bolt
#

Increase time with time?
And clamp it so it never increases after some arbitrary time?
Sorry, I didn't sleep at all

neat orchid
#

haha that's why I said with code? I meant expose the input value I wanna control

#

and increase it with code

#

increase with "time" was supposed to be the human term, not the time node

grizzled bolt
#

You can make a global float property that you increase in code and don't allow to overflow

neat orchid
#

yeah that's what I'm talking about

grizzled bolt
#

Then for preview purposes make it also run outside of play mode, or use the old Time node while dodging the overflow issue

neat orchid
#

I was surprised with this behavior of time in shaders but what you said makes sense cause when I tried to use it, it always seem to show an effect that would happen at great values