All Questions
107 questions
1
vote
1
answer
95
views
How do I render a sector (pie/cake slice) of a circular Unity 2D GameObject?
I have a circular GameObject in Unity 2D with a SpriteRenderer attached.
I want to attach a custom component to my ...
0
votes
1
answer
98
views
How Can I programatically identify a Material in Unity?
I have some gameobjects that in some conditions have an additional material added to them programatically at runtime.
I then later want to be able to remove that specific material. How can I identify ...
0
votes
1
answer
83
views
Unity shader invalid subscript worldPos
I am trying to write a shader for Unity that replicates Splatoon's painting system, but I cannot get the shader to compile. It has an error on line 41 stating invalid subscript 'worldPos' at line 41 (...
0
votes
0
answers
35
views
How do I repeatedly change the colors of a list of cubes in run time without causing a bottleneck to my fluid simulation?
I am coding a 3d fluid simulation. I want to render each cell of the simulation grid with a cube, so I have a grid of cubes. Each cube has its own color, and the colors are stored in a compute buffer. ...
0
votes
0
answers
301
views
Frustum culling using compute shader, how?
I'm working on a little project for a while - creating an area where you can spawn a bunch of grass. I've overcame a major headache when figuring out the GPU instancing for the mesh and the code looks ...
0
votes
0
answers
69
views
How to hide part of character under slope
As shown in the image below I'm trying to find the points in which a line in the world space intersect a sprite. The idea was to get the corresponding values inside a shader to play around with pixel ...
0
votes
1
answer
135
views
Which is better to use C# and Shader to move textures?
We could use C# code Material.SetTextureOffset to move a texture, and ShaderGraph can do the same by Time and ...
0
votes
1
answer
222
views
Custom Unity shader makes mesh look different
I am very much new to custom shaders. My actual problem is that I want to fade a mesh in and out via C# in Unity. However, the materials on the mesh I am using are opaque and setting them to ...
0
votes
0
answers
97
views
Increase opacity of a floor plane along the path travelled by a cube
I have a plane object (a normal Unity 3D Plane, but it can be a complex floor in the future) and a cube is moving on the plane.
Currently, the plane is transparent. I want to make the plane opaque as ...
0
votes
0
answers
179
views
Problem with drawing on texture
I'm trying to do a simple stretch-card erase effect. Everything works on the PC (both in the editor and in the build). But when I make a build for android, something goes wrong.
Pc Version (work vell):...
0
votes
0
answers
345
views
How to make render texture grayscaled?
I have made a minimap, but I don't know how to make it less colorful and haven't find any solution for this.
0
votes
0
answers
136
views
ComputeBuffer Values messed up when calling the dispatch many times in a row
I'm having a RWStructuredBuffer called AffectedVertices give me random data instead of 1 simple value to resultAffectedVertices, ...
0
votes
0
answers
67
views
Spawning noise-based fire effect with code, no prefabs
i'm a beginner in Unity, and I'm taking a Graphics course about algorithms of procedural textures/modeling.
I would like to write a noise-based fire shader like this one:
I would like to then be able ...
0
votes
0
answers
232
views
How to make under-construction sprites have blueprint graphics?
In my game, every placeable object and structure will only be placed as a blueprint, which the characters will then automatically build.
An example from "RimWorld":
Objects placed as ...
2
votes
0
answers
2k
views
Collapse a 3D model to 2d with Shader?
I'm trying to recreate an effect of 3D sprites similar to Ocotpath Traveler (2d sprite similar to billboards/imposters in 3D space, showing 8 sides of the character based on where they're facing), ...