Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
122 views

How to get shadow from additional light in Unity custom shader? (Self-solved)

I’m working on a project in Unity where I’m using a compute shader to render grass. The rendering path is Forward+, and I’m trying to make the additional lights affect the grass. I want to achieve ...
user16287208's user avatar
1 vote
0 answers
78 views

Writing to a RWTexture2D in Fragment shaders

I'm new to this topic, and I know this sounds stupid, but I just really want to learn! So I found out I can write to RWTexture2D from my fragment shader(according to forum), but I can't really find ...
phal5's user avatar
  • 11
0 votes
0 answers
343 views

Unity does not consistently provide reflection probe colors in surface shaders

For some mysterious reason, only at certain camera positions/angles, a boilerplate surface shader does not properly return a color from unity_SpecCube0. It either returns pure black, or pure white, ...
Zoop's user avatar
  • 1,085
2 votes
0 answers
57 views

Holodeck effect: Surface shader only partially blocking surfaces behind it?

I am attempting to write a cubemap shader that can be applied to any geometry, with the goal to create a Holodeck-like effect. This shader would be applied to the walls/floor/ceiling of a room, and ...
Zoop's user avatar
  • 1,085
1 vote
0 answers
64 views

Is it possible to pass a custom position to calculate lighting in unity surface shaders?

I want to create a shader that uses different coordinates for light calculations than for what's being displayed. This probably sounds strange, but I would like to do this for lighting a top-down 2D ...
Snow Snakz's user avatar
2 votes
1 answer
153 views

How to step through 3D noise for volume textures?

I'm creating volume textures for volumetric ray marching (Creating this with Unity and a fragment shader) Example I have depth value that increases the starting position on the x, y or z axis. Doing ...
Buttermilch's user avatar
2 votes
1 answer
360 views

How to optimize color reduction and dithering

I have the following function inside fragment shader, but it reduces fps by 7 half3 ClusterAndDithering(half3 color, half2 uv) { half2 clusters = half2(16, 16); color.xyz = RgbToHsv(color....
Artromskiy's user avatar
1 vote
2 answers
709 views

Cull off parts above the mesh

So, I want to make scene same to this Sphere Scene Now I have mesh with random generation as a ground and a sphere. But I dont't know how to cull off spheres geometry above mesh. Tried to use Stencil,...
Artromskiy's user avatar
2 votes
1 answer
2k views

Unity 3d Sprite Shader (How do I limit Max Brightness to 1 with Multiple Lights Hitting)

I am creating a videogame in Unity. Every sprite is rendered with a Sprite Renderer with a Material that has the CornucopiaShader.shader. The problem I have is I want to limit the max brightness (or ...
David's user avatar
  • 65
1 vote
1 answer
3k views

Combining Two Shaders into One Shader

Unity Project, Want to combine these two shaders into one shader to get both of their functionality. One shader is for lighting, the other shader is for rendering better. How do I combine? Shader "...
David's user avatar
  • 65
4 votes
0 answers
2k views

Object-To-Clip for Unity Canvas Image Shader

The TL;DR When applying a shader to a UI.Image object in a Unity3D canvas, UNITY_MATRIX_MVP appears to be relative to the Canvas renderer, and not the Image object itself being drawn. Is there a ...
Johannes's user avatar
  • 6,419
0 votes
0 answers
207 views

HLSL lighting based on texture pixels instead of screen

In HLSL, how can I calculate lighting based on pixels of a texture, instead of pixels that make up the object? In other words, if I have a 64x64px texture being rendered on a 1024x768px screen, I ...
Felipe's user avatar
  • 11.9k
-1 votes
1 answer
1k views

How to fix shader invert y on IOS

This is shader to make UI blur. This shader work fine with android, but the y is invert on IOS device. I try to search for an answer but I don't understand how to implement it. Because it is using ...
Tengku Fathullah's user avatar
1 vote
0 answers
379 views

implement smoothing methods in fragment shader in unity

i'm trying to make a smoothed model from a 3d texture in unity3d game engine. but problem is here, the model is not smoothed and the slices are obviously visible , i also had some changes on my shader ...
masoud khanlo's user avatar
3 votes
1 answer
5k views

How to make Unity glass shader only refract objects behind it?

I am looking for a glass shader for Unity that only refracts the objects behind it, or ideas for how to modify an existing glass shader to do that. This screenshot shows what happens when I use FX/...
Mike's user avatar
  • 963
0 votes
1 answer
1k views

issues converting HLSL shader to shaderLab

I've been working on a project which involves me working with shader coding something I'm not familiar with. I've been provided some HLSL code from another team member and have been trying to ...
David Parsonson's user avatar