Quantcast
Channel: Questions in topic: "shader programming"
Browsing all 169 articles
Browse latest View live
↧

How to set compute shader float precision to half explicitly in Unity 2022...

I'm optimizing for mobile, so I'd like all compute shader floats to use half precision explicitly. For example, if I fill a compute buffer with half floats on the CPU side, I'm not guaranteed that the...

View Article


How to use the compute shader to sample the depth map under URP and calculate...

Here is my code, but the output is always weird. compute shader: #pragma kernel WaterSplash struct Particle { float3 position; float lifetime; float showScale; }; RWStructuredBuffer particleBuffer;...

View Article


Possible to Make a shader graph for a segmented health bar RECTANGLE?

This is really meant to eventually be a bar recognizing ammo but the implementation should be the same so I'm saying health bar since that seems a more common task. I saw a video and asset on the store...

View Article

Change UV Offset according to target objects to achieve a "Look At" effect

I am currently working on a project that has humanoid models with 2d eye textures like in anime. I have made an eye shader that change the UV offsets using a slider to change the position of iris in...

View Article

Add fog to vertex shader

I've been trying to modify a shader to be effected by Unity's exponential fog. I'm not really verse in shader code, and I've been searching through previous answers. I think it has something with...

View Article


Need help with my billboard shader

Hey, I am working on a billboard shader which I am using for my 2D sprite based old school doom like shooter. The billboard shader I created(mostly part copied from google) is working fine but if the...

View Article

How to create a shader for a dynamic linear gradient

TLDR; How do I create a linear gradient in Shader Graph with dynamic color segments (dynamic in both quantity and color)? ---------- Hello! I'm working on a project where I am literally attempting to...

View Article

A public list of color in shader.

i have to create a color list for my material that i can modify from unity interface. Properties { _MainTex ("Texture", 2D) = "white" {} _ColorList("ColorList", ???) = ??? }

View Article


Packing Height Map with Normal

I was hoping to pack my height map value with something else such as the normal or the roughness etc... However, it appears that the UV offset the height provides must be applied to both the albedo...

View Article


Shader error in 'libS/Lit': redefinition of 'SurfaceData' at

Shader error in 'libS/Lit': redefinition of 'SurfaceData' at PackageCache/com.unity.render-pipelines.universal@10.8.1/ShaderLibrary/SurfaceData.hlsl(5) (on metal)

View Article

Why unity_Matrix_VP does not match what I've computed in script?

I'm working on a custom render pipeline using deferred rendering, in which I need to pass the inverse of VP matrix to reconstruct world position from depth. But things just never get right. --- I set...

View Article

Get shadowmap in HDRP with commandBuffer

The code I've been working on for ages has this line of codecmd.DrawRenderer(rc.renderer, srcMaterial, rc.submeshIndex, shadowPass); which it takes the material's shadowpass and put the result into a...

View Article

Shader graph: how to treat color as vector4?

I have a texture that represents vertex positions, i want to modify it to bring values to needed range, but when i multiply it i don't get the values i expect. Input gray color is 128, but after...

View Article


Multi layer texture transparent when not supposed to

Hi, I am kinda new when it comes to shaders, so I am trying to make a few things in order to learn. One the things i am trying to do is a flage made of four textures in differents layers, each layer...

View Article

Problems with Alpha when Sampling Texture 2D

I have added a new sprite and I want to create a glow around it using shaders -> Material. It looks fine in the normal editor: https://i.imgur.com/bjRo7ax.png But it breaks when sampled in Shader:...

View Article


Converting a CG Shader to HLSL Shader from a Sebastian Lague video,Build-In...

Hi, I've been trying to convert the shader Sebastian Lague used in his video about Portals to URP. My experience in HLSL or any shader language is close to none, so any help is appreciated. This is the...

View Article

Pink Shader URP Lit Shader Graph

Version 2020.3.21f1 My shader is displaying as pink. I have set my Active Target for my shader to Universal. Below is what current setup currently looks like. Please let me know what I need to do to...

View Article


Using Environment Reflections in an unlit shader?

![alt text][1] [1]: /storage/temp/197674-capture.png How does one go about using this feature in an unlit geometry shader? I've noticed changing the values changed how my surface shaders looked but...

View Article

How to merge UV parameter in shader graph

Hello, I have trouble merging two parameter for my UV texture in my shader graph. The first one, is a UV that randomize my texture (on the right the original texture and the preview render), alone this...

View Article

How to make TextMeshPro UI text single-sided

I'm making a card game that uses TextMeshPro for information on each card. When the card is face-down, I don't want any text or sprites from the other side showing. To solve sprites/Images being...

View Article
Browsing all 169 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>