Questions tagged [shaders]

a computer program that runs on graphics hardware and provides a high degree of control over how scenes are rendered

Filter by
Sorted by
Tagged with
0 votes
1 answer
41 views

What would be a good approach to create an abstraction for a game object without textures?

I am practically pretty new to OpenGL development and right now doing some research in Java with LWJGL. But it's really not a question about Java or C++ (GLFW, etc.). It is about OpenGL > 3 api. ...
user avatar
1 vote
1 answer
110 views

How to deal with insane amount of shader variants waiting to be compiled in Unity >= 2021.2 / URP >= 12?

Since Unity 2021.2.0b7 (that is, URP 12.0.0), there has been a well known problem with absurd number of shader variants wanting to be compiled for even a somewhat simple shader (i.e. shaders generated ...
user avatar
  • 76
0 votes
0 answers
18 views

Prevent the vertex normals from being recalculated when a skeletal mesh is deformed?

I am trying to create a game with stylized shading like Arc System Works Style, which requires the normals to be edited by hand (I do so in Blender). However, after importing to Unreal Engine, these ...
user avatar
0 votes
0 answers
16 views

Unity paint texture isn't working when a shader is selected

I'm trying a create a custom shader for my terrain. I'm a beginner so at this moment I was just trying to experiment with texture blending (and I might not be following best practices). I have created ...
user avatar
  • 101
0 votes
1 answer
31 views

Tangent Space View Direction based factor value remap

I'm trying to setup a mask similar to what Fresnel produces. Unfortunately Fresnel gives pretty bad results at grazing angles so I ended up using this : ...
user avatar
  • 1,045
1 vote
1 answer
110 views

How do I implement this distortion ripple effect?

I would like to implement the following running effect in Unity. When the player character moves, it creates some sort of rings around it to give the impression of high speed. I have searched for ...
user avatar
0 votes
0 answers
10 views

How to replace a world space position Y test by an equivalent view space test

I'm doing world position Y test to select ground pixel where I want my SSR to appear only. During ray march I'm doing the same to reject ground pixel. For this I have to retrieve view space position ...
user avatar
  • 47
0 votes
1 answer
67 views

Sphere rolling shader like ice cream

now I can make cylinder shape with shader. But what I want to do is like picking up ice cream with an ice cream scoop. How can I do this?
user avatar
0 votes
1 answer
65 views

Unity HDRP Emissions - When setting over 1 nit, blue becomes progressively more purple

I've been trying to use a HDRP Lit Shader material to create an intense lighting effect in a dark environment. I'm using a texture as an emission mask which is simply a 16x16 black png split into ...
user avatar
0 votes
0 answers
49 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 ...
user avatar
0 votes
2 answers
127 views

How to support run-time shader modification/code execution?

I would like to create an educational game, part of which involves allowing the user to modify code for procedurally generating geometry on the CPU and modify shader code and see the changes they make ...
user avatar
  • 101
0 votes
1 answer
53 views

Why would some assets require a transposed TBN matrix?

I'm writing an OpenGL/DX11 Windows/Linux "engine" and I've encountered a confusing behavior in DX, specifically. For math, I'm using GLM, which means all of my HLSL ...
user avatar
  • 101
0 votes
1 answer
53 views

D3D11 CreateInputLayout error: CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE

I created a simple shader, and it compiled, but when using the vs as input layout, it failed with CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE. I don't know why. ...
user avatar
0 votes
1 answer
50 views

Scaling and offset problems with screen space reflexion in DX11

I've transposed from OpenGL to DX11 a SSR ray marching shader (code found here : https://community.khronos.org/t/screen-space-reflections/69987). It seems to work well but I have had an initial ...
user avatar
  • 47
0 votes
0 answers
28 views

Draw a plane in fragment shader using determinant?

I'd like to use the determinant of a matrix to draw a plane in the fragment shader. But I don't understand how to come up with the matrix. Let's say that I have 3 points that lie on the plane: A, B, ...
user avatar
1 vote
1 answer
98 views

Screen space reflections bug

I try to implement screen space reflections in my graphics engine using ray marching algorithm. After a lot of trying I got this result: https://youtu.be/yzkgpcliBVQ As you can see, the reflections ...
user avatar
0 votes
1 answer
73 views

Why do I still get values from _CameraDepthTexture even if I didn't set depthTextureMode?

I forgot to write this C# code to enable depth from my camera: ...
user avatar
1 vote
1 answer
144 views

Can't make simple shader transparent in Unity

I have already visited a lot of links, but non of them did not help me. I just want to make a window as a plane (face) with texture with transparency. .shader: <...
user avatar
0 votes
1 answer
32 views

rendering the position of a mesh in a shader as a color, but the color does not match the actual position

...
user avatar
0 votes
0 answers
23 views

Procedural Terrain Computing Normal in Shader

I've been pulling my hair out on this. I'm trying to paint a procedural terrain. The white ball in this photo is supposed to be the light source. However, it looks like it is shining black light. The ...
user avatar
  • 111
0 votes
0 answers
27 views

Usefullness of a manual vertex shader optimization?

After having implemented a texturecube RGBA16F to generate shadows for 4 pointlights in one pass (forward shader), I've compared with array[4] of textucube R16F and with texturecuberarray with 4 ...
user avatar
  • 47
1 vote
2 answers
128 views

Combining palette-swaps and smooth scaling in a pixel-art shader

I am creating a pixel-art game in MonoGame, and have written a shader to perform various effects on a sprite when rendering it, such as performing palette swaps, highlighting outlines, etc.. Most of ...
user avatar
  • 23
0 votes
0 answers
197 views

How does the Unity Editor use shader stencils in the UI?

It seems clear that Unity UI has some use for shader stencils, based on the fact that UI shaders tend to have something like this: ...
user avatar
  • 161
1 vote
2 answers
92 views

Custom directional shadow map from sun

Due to some material features, I need to create my own directional shadow map. Everything seems to work ok, until the moment where I compare depths. First I add a camera component to the directional ...
user avatar
  • 173
1 vote
0 answers
139 views

Unity - Strange shiny reflection on terrain

So I'm trying to figure out, what's causing this strange reflection on my terrain. I've tried almost everything to get rid of that shiny circle, but to no avail. It follows me wherever I go, so it's ...
user avatar
0 votes
0 answers
33 views

Shader misbehaving on device

I'm working with Objective-C and SpriteKit, and have decided to add a shader to one of my nodes to give it a simple flash animation when I need to. Within a simulator environment, and testing the ...
user avatar
  • 213
0 votes
0 answers
136 views

Gradient border/drop shadow URP unity shader graph

I am using Unity Universal Render Pipeline and shader graphs in my game. Does anybody know how I would go about setting up a shader graph that adds a black gradient drop shadow/border with the game ...
user avatar
2 votes
1 answer
106 views

Unity shader to turn top-down view of scene into a stylized "minimap" view?

I'm working on a tile based isometric game and the minimap right now is just a top-down camera. Usually I just attach some markers to the top of the objects in the world, which are only visible by the ...
user avatar
  • 627
0 votes
1 answer
68 views

Unity Shader - Procedual animated texture

i am new to shaders and experimenting with the free unity shader forge plugin. due to project limitations i use unity 2019.4 and can not use unitys shadergraph =( https://www.youtube.com/watch?v=FM-...
user avatar
0 votes
0 answers
36 views

How can I make the inside of a mesh solid?

I followed this tutorial to create a simple liquid effect. I am trying to modify it to make an effect where it looks like the liquid is covering an object. I have a shader that changes the alpha of an ...
user avatar
  • 1
1 vote
0 answers
111 views

Cleaning effect with progress counter

I'm working on object cleaning in unity. This effect actually works. What I still need is the progress, do you have any idea how can I count the progress of the cleaning? (my code is below) Thank you ...
user avatar
0 votes
0 answers
31 views

stencil as shader resourceview

I would like to use the stencil information in my depthstencil buffer as shaderresourceview (DX11) in my shader. I have a DSV D24S8 from which I create a R24X8 resource fine using the red for ...
user avatar
  • 47
1 vote
1 answer
134 views

Vertex color values are not smoothly transitioning/interpolating in Godot shader

I'm trying to write a shader for terrain that will color the mesh based on slope angle, ie color the sides of mountains or other steep surfaces a different color than the ground. In my shader I am ...
user avatar
0 votes
0 answers
19 views

Trouble calculating position from depth buffer

Position can be reconstructed from depth but I did not succeed in achieving the correct calculation. I've found these two pieces of code for view/world pos, but can't make it work. For getting view ...
user avatar
  • 47
0 votes
0 answers
131 views

Make shader independent from object's world position

I am not sure if I titled the issue correctly, but I will describe in details: I have a building as a single mesh, but with windows as separate faces whith individual materials. I want that windows to ...
user avatar
1 vote
1 answer
270 views

How to add antialiasing to my circle shader?

I made a circle shader by following this tutorial: https://www.youtube.com/watch?v=Ww1GbfnBH_Q. It is simple flat circle shader. The problem is that there are visible jigged lines on the circle edges. ...
user avatar
  • 129
0 votes
1 answer
17 views

Deffered shader with alpha : orient target writing

I have this bit of shader code to orient SV_target writing depending on alpha value for SV_Target0 : color0 = (input.a == 1)? float4(some value) : float4(0,0,0,0); for SV_Target1 : color1 = (input.a ...
user avatar
  • 47
0 votes
0 answers
32 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):...
user avatar
0 votes
0 answers
50 views

Shader for multichannel SDF

Based on the paper by valve and the thesis by Viktor Chlumsky, I try to recreate a multichannel SDF. It's about this part: I recreated the SDF for the diamond. I have no idea if the SDF is correct, ...
user avatar
0 votes
0 answers
12 views

Combine fixed4's inside shader

In my shader I have 2 fixed4's: one for land and the other for water. The land fixed4 is completely opaque whereas the water <...
user avatar
  • 191
1 vote
1 answer
39 views

Unity Shader w Color Bar for Fragment Color Manipulation

Situation I have a shader for images with "wonky" colors - the reason the colors are so messy is because it's a sneaky way to encode data into the RGB color channels eg the red channel is ...
user avatar
  • 191
0 votes
0 answers
25 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.
user avatar
0 votes
0 answers
14 views

Shirt in front of body: Render a gameobject always in front of another despite position, keep lighting [duplicate]

How do you "hide" the body behind a shirt, or render the shirt as always in front of the body - without losing the lighting?
user avatar
  • 174
0 votes
1 answer
322 views

How can I tint the color of a decal in Unity?

For my game, I want some sort of indicator of if a space is walkable or not. To achieve this I figured I would create a decal projector and have it follow the mouse cursor around, displaying a decal ...
user avatar
  • 7,650
0 votes
0 answers
22 views

Parallax mapping issue

Can anyone guess why this shader is only working from a top down view position (0.0, -1.0, 0.0). The parallax mapping calculation in the shader below is basically copied directly from learnopengl.com ...
user avatar
  • 21
0 votes
1 answer
358 views

Why is the Unity pixel color read from RenderTexture bigger than 1?

The pixel color component read from the Unity renderTexture is bigger than 1.0 without HDR environment map. I'm writing a mini program to test the reflectance of Unity PBS. I use six pure white (1,1,1,...
user avatar
  • 33
0 votes
0 answers
289 views

Rotate a texture around its center

I am tryna developing a little game library in C++ with OpenGl. I got stuck on the texture rendering step. My achieve is that to rotate the texture around its center. Now, I already know that the ...
user avatar
  • 25
0 votes
0 answers
42 views

Why do we still see infinity vector space after normalizing World space? ( Unity Shader Graph)

Why do we still see infinity space after normalizing vector space? I assumed that some kind of effect would be obtained. As I see what happens to the space after it is normalized and how this ...
user avatar
1 vote
0 answers
38 views

How to make a cloudy looking planet?

In my game you navigate in space and you can come across planets. You can approach the planet and then land on it. At first I wanted the planets to be spheres, but then I realised how unpractical this ...
user avatar
0 votes
0 answers
7 views

Why do we see such effect after Normalize X value from Position Node ( in World Space )? ( Unity Shader Graph ) [duplicate]

Why do we see such effect after normalize X coordiante from Position Node ( in World Space )? How does it works? What Normalize node do with X Coordinate? Do we normalize X value of vector or length ...
user avatar

1
2 3 4 5
37