Questions tagged [shaders]
a computer program that runs on graphics hardware and provides a high degree of control over how scenes are rendered
2,004
questions
0
votes
0
answers
37
views
Why distant objects are becoming white when camera is still?
I have a shader attached to quads that I'm generating far away using
script. The quad is capable of keeping the color when camera is moving
however the color becomes white when camera is still. I can'...
0
votes
0
answers
33
views
Unity shader graph show through walls
How to make a shader graph shader display through walls while keeping the existing texture in unity. I also only want to use shader graph only nothing else.
Example: https://hyunkell.com/blogfiles/...
0
votes
0
answers
16
views
Breaking up effect for Android
I am trying to create an animation for an Android TextView. I want to break-up the text into tiny pieces and apply some physics simulation as it breaks up!.
I will probably need to implement a custom ...
1
vote
2
answers
67
views
Persist global shader parameter
I use Shader.SetGlobalVector to modify the behaviour of multiple shaders. I added a MenuItem to change these parameters in ...
0
votes
0
answers
36
views
Sharpen Unity game in post processing
I am making a game that uses a custom voxel raytracing shader which preferably should run on lower end pcs. Since raytracing performance is extremely affected by resolution I would like to add a ...
1
vote
0
answers
39
views
Creating 3d Cloud within the box using Metal shader
I tried to create a cloud filled in the box geometry, I tried using raymarching with noise texture as well direct noise function and fbm - fbm motions is good. but cloud is not get proper result like ...
0
votes
0
answers
31
views
How to do DOF & motion blur using 1 image & depth?
Is there any way to do DOF & motion blur based on just 1 image & its depth image on a mobile platform?
0
votes
0
answers
30
views
Multiple Shaders With Sprite Batching
I have coded a game in OpenGL and for rendering I used a Sprite Batching technique to draw many sprites in a single call to glDrawElements(). But as soon as I ...
1
vote
0
answers
37
views
Procedural fractal Perlin flow noise for mobile
I'm trying to use the Fractal Perlin flow noise from Chaos Software (shared under the MIT licence)
...
0
votes
0
answers
34
views
How does Linear and Exponential Fog work in Unity URP?
I am a novice in Unity, I see that volumetric fog is not available when using the URP and the recommended method is to use Linear or Exponential Fog.
I played around with it a little. Even though ...
0
votes
1
answer
74
views
How to compile a node-based material system to usable shader code / data buffers / texture resources?
Let's suppose we're rendering a scene using Vulkan with objects with many different materials that are built using nodes.
Within a graphics pipeline, there can be only fixed shader code, so I'll have ...
0
votes
0
answers
79
views
How can I override the directional light processed by a shader?
I'm building a solar system and have made the simplifying assumption that the sun will always be at 0,0,0.
Rather than worry about "real" lighting, my planet shader just works out where it ...
1
vote
1
answer
116
views
Is OpenGL Shader a CUDA kernel?
I am working on sone articles, and need a bit of clarity on following question. Is the OpenGL Shader a CUDA Kernel? When searching the web, I have seen information on differences between kernel and ...
1
vote
0
answers
44
views
How do I use a Unity unlit Shader to plot a curve with even thickness
I'm new to Unity shaders and I'm using a Unity unlit shader to plot a function of x. For example, y = sin(x). This is very easy with the following code:
...
0
votes
0
answers
56
views
Hide objects behind invisible wall
I am developing a VR application in Unity where I have a 3D object (a plane) flying over the player's head. I am using a Skybox for the background and I want to make the plane "disappear" ...
0
votes
0
answers
27
views
What are the consequences of using AfterRenderingTransparent for grass?
I followed a tutorial for unity URP stencil to hide objects, I want to use it to hide terrain grass under objects like vehicles, houses, etc..
The tutorial says to create 2 layers, and create render ...
0
votes
0
answers
56
views
Blending/gradient/smoothing between textures in Texture2DArray in HLSL shader
Well, I have this triplanar shader:
...
0
votes
1
answer
35
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
31
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. ...
1
vote
0
answers
54
views
Game published for web freezes for 2-3 seconds the first time an explosion effect triggers
Using Godot 4.2.1
when exporting my game to HTML5 it runs completely fine until an explosion effect is spawned on screen for the first time when killing a mob, the game freezes for an entire 2-3 ...
0
votes
0
answers
38
views
How to check input/output data for shaders in Renderdoc?
How can I check whether my vertex and pixel shaders' input and output have data in Renderdoc?
I have a problem with my pixel shader when I try to include input color. I get a black screen. When I ...
1
vote
1
answer
99
views
Use DirectX 11 & HLSL in SDL
I saw Lazy Foo using OpenGL & GLSL in SDL, but I want to use DirectX 11 & HLSL in SDL.
Is there a way to do this, and how?
0
votes
0
answers
34
views
Unity Grayscale camera but mask colors
I'm trying to replicate the example given in this thread:
https://gamedev.stackexchange.com/a/185593/179264, and I was able to, but for now I want to implement the "mask" thing to 2d lights ...
3
votes
1
answer
145
views
Is it possible to use a pre-existing texture buffer containing vertex data to initialise a vertex buffer for rendering in OpenGL v4.6?
I'm generating a heightmap in a compute shader in OpenGL v4.6 and storing it to a texture.
Lets say I actually store the full vertex data in that texture instead of just the height, which is a trivial ...
0
votes
2
answers
57
views
Custom matrix structure with OpenGL shaders
I have a MAT4 structure.
...
0
votes
0
answers
231
views
When compiling shaders in OpenGL, I get random error messages
I am trying to follow LearnOpenGL while coding in the Zig language, and something that is very odd is that sometimes my shader compilation fails even though I changed nothing between executing the app....
0
votes
0
answers
42
views
Is Unity Legacy/Diffuse shader almost as efficient as Mobile/Diffuse shader (for mobile apps)?
I am developing mobile apps. I know that Mobile shaders are the best options for mobile apps in terms of fast performance.
However, I purchased 1 Unity asset, which only works with Legacy/Diffuse ...
0
votes
0
answers
36
views
How to implement graphics API functions like setUniform on a cross-platform shader in VLang?
I've been working on a C++ game engine for a while, but I decided to scrap the project because doing it in C++, despite my best efforts, I could feel the technical dept building. As such, I switched ...
1
vote
2
answers
183
views
How do you handle shaders/graphics while remaining cross-platform?
I'm building a C++ based game engine, and I have my ECS complete as well as some basic components for stuff like graphics & audio. However, I'm currently using a custom interface on top of SFML ...
1
vote
0
answers
61
views
How to calculate a direction vector from a 3x3 rotation matrix?
I have a dataset containing 2D images of telco towers and metadata. Each 2D image has 3x3 rotation matrix which provides orientation info about the drone when it captured the image.
Now I have a 3D ...
0
votes
1
answer
89
views
Assigning Color Won't Work
I am trying to make a palette-swap shader. Here is my code:
...
0
votes
0
answers
38
views
Terrain and SpeedTree objects render correctly in Editor, but not in Build in both Legacy and URP
The game runs and shows perfectly in Editor, but when I make a build, terrain and some other objects become invisible. This happens the same in both Legacy (Standard) and URP.
I tried to create shader ...
0
votes
0
answers
41
views
Why do my shaders render differently in the simulator?
I am using simple shaders on the cards in my game. The shader is assigned as a material to a white image the covers the whole card.
They render as intended in the scene view, but do not in IOS ...
0
votes
1
answer
38
views
How to remove a shader (or material) from a particle system in Unity?
I bought a Unity asset that has a particle system that displays many small cubes flying around. Then, the creator of this particle system add their own shader (or material) at the end of the particle ...
0
votes
0
answers
86
views
How to add a toon / cel shader to a URP 3D project?
I'm new to Unity and I've been frustrated for the last 5 days. I'm trying to apply a toon / cel shader to my object which I've imported from Blender. It already has a default material called ...
2
votes
1
answer
107
views
Why do you use logarithmic curve to fix distortion of texture?
I'm a noob shader learner, and I came across this question about animated shaders in Unity: Animated textures for models; How to write a shader?
After reading the answer, I kind of understood the ...
0
votes
1
answer
179
views
Creating a pinch distortion shader
I'm attempting to recreate this effect using a shader in Unity, using version 2023 with HDRP:
The effect appears to be pinching pixels behind the object the shader is applied to and dragging them ...
1
vote
0
answers
89
views
UV map shift for VFX & shaders
(I would like to say right away that I personally am not a programmer and may not be so competent in what is said below.)
My friend and I are creating a small "game" engine. We have a task ...
0
votes
1
answer
85
views
How to get the direction to the sky a pixel is facing to draw a sky?
I am drawing an empty texture over a framebuffer with a fragment shader active to try and draw a sky, but I need the direction each pixel is facing in (for correct linear perspective) to draw the ...
0
votes
0
answers
191
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
143
views
Overlapping geometry (Z - Fighting) solution with shader in Unity
I have geometry that is overlapping with other geometry (the floor). So, I used a shader to bring my desired mesh to the top. However, a new problem arose: the shader was rendering not only on top of ...
2
votes
2
answers
214
views
How do materials and shaders work in graphics programming?
I stumbled upon a few videos about shaders and materials from The Cherno and my understanding is that materials are this sort of input that a shader takes to calculate an output instead of hard coding ...
0
votes
0
answers
36
views
How do you recreate a standard lit shader using custom lighting?
When using a standard lit shader the environment reflection on the material gets soft/blurry when you have smoothness at anything lower than 1 (which would be perfect mirror reflection). But when you ...
0
votes
1
answer
88
views
GLSL limit uniform sampler2D to 4 for some reason
I'm writing a deferred rendering pipeline and my fragment shader looks like this:
...
0
votes
1
answer
199
views
Shader to give the effect of a 2D character covered in oil
I have a 2D pixel art game where characters can be covered in a flammable black oil-like substance and I am looking for a simple way to depict that visually.
Simply tinting the character black won't ...
0
votes
0
answers
181
views
Depth Map doesn't work in 2D URP
This is a further question from my last, originally I was trying to change the way the depth map is rendered per-pixel. However, through more testing, I've found that actually it has nothing to do ...
3
votes
2
answers
1k
views
It's possible to use more than 4 channels of a texture in GLSL?
I have a Texture with 6 channels. Each channel store a mask that is used to change a color of a part of my player's sprite.
When the texture only had 3 channels it was easy to implement this color ...
0
votes
0
answers
44
views
How do I pick terrain in GLSL/OpenGL by picking 2D vertices positions?
Presumably the problem is with the internal formats and my understanding of that, but I've been stuck a while, got this sort of approaching working fine on a more straight forward colour picker, but ...
1
vote
1
answer
87
views
Problem recreating shader on Phaser 3
I'm trying to recreate the following shader from shadertoy using Phaser 3:
https://www.shadertoy.com/view/wdG3Rz
I managed to fix the errors I was getting but it just loads an empty black square when ...
1
vote
0
answers
99
views
How do you supply custom reflections to a shader?
I'm using Unity with Amplify Shader Editor and/or Shader Graph, but willing to learn to write a shader if that's what it takes to achieve what I need.
I need to be able to supply my own reflection ...