Skip to main content

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
0 answers
20 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. ...
Mohamad T Shehab's user avatar
1 vote
0 answers
37 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 ...
buzzbuzz20xx's user avatar
0 votes
0 answers
26 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 ...
mueoc mueoc's user avatar
0 votes
0 answers
27 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?
M 027's user avatar
  • 1
0 votes
0 answers
28 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 ...
crgd 23WD's user avatar
3 votes
1 answer
115 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 ...
Iron Attorney's user avatar
0 votes
2 answers
48 views

Custom matrix structure with OpenGL shaders

I have a MAT4 structure. ...
Valtsuh's user avatar
  • 99
0 votes
0 answers
78 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....
user avatar
0 votes
0 answers
25 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 ...
Job_September_2020's user avatar
0 votes
0 answers
32 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 ...
Spencer Rosas-Gunn's user avatar
1 vote
2 answers
123 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 ...
Spencer Rosas-Gunn's user avatar
1 vote
0 answers
52 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 ...
Moiz Ghuman's user avatar
0 votes
1 answer
87 views

Assigning Color Won't Work

I am trying to make a palette-swap shader. Here is my code: ...
TheJalfireKnight's user avatar
0 votes
0 answers
30 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 ...
Faizan Khan's user avatar
0 votes
0 answers
37 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 ...
Devin's user avatar
  • 1
0 votes
1 answer
26 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 ...
Job_September_2020's user avatar
0 votes
0 answers
45 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 ...
cak3_lover's user avatar
2 votes
1 answer
100 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 ...
V.R.S's user avatar
  • 23
0 votes
1 answer
93 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 ...
Sean2148's user avatar
  • 135
1 vote
0 answers
57 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 ...
InkCg's user avatar
  • 11
0 votes
1 answer
78 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 ...
Tachytaenius's user avatar
0 votes
0 answers
111 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 ...
Leedy's user avatar
  • 1
0 votes
0 answers
70 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 ...
Muhammad Faizan Khan's user avatar
2 votes
2 answers
143 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 ...
Konjointed's user avatar
0 votes
0 answers
31 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 ...
Ben Mora's user avatar
  • 467
0 votes
1 answer
61 views

GLSL limit uniform sampler2D to 4 for some reason

I'm writing a deferred rendering pipeline and my fragment shader looks like this: ...
Ronen Ness's user avatar
0 votes
1 answer
181 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 ...
Martin's user avatar
  • 43
0 votes
0 answers
104 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 ...
Pow's user avatar
  • 404
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 ...
NotAlmostGauss's user avatar
0 votes
0 answers
39 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 ...
Paul's user avatar
  • 1
1 vote
1 answer
66 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 ...
Javier Villanueva's user avatar
1 vote
0 answers
65 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 ...
Ben Mora's user avatar
  • 467
1 vote
1 answer
122 views

Unity shader to give thickness to flat plane

I have this hexagonal grate floor: Which is a flat plane with the following shader: The hex lattice created using the method by Andrew Hung. Albedo and metallic/smoothness shader are just simple ...
Dr Rob Lang's user avatar
0 votes
1 answer
85 views

How do I render zones like Cities Skylines district tool?

I am trying to implement a zoning system like the district tool in Cities Skylines (see screenshot below). The player is able to draw/modify/erase zones with a brush tool. Internally, I represent each ...
sqd's user avatar
  • 111
0 votes
0 answers
26 views

Efficient Implementation of Dynamic Snake-Like Body in UE5: Seeking Advice on Optimized Approach

Platforms: iOS, Android, and PC. I want to implement a snake body that can dynamically grow in length, narrow, and bend (simulate body movement, similar to bending in an arc). I'm using UE5, and ...
Toki.u. Doki's user avatar
0 votes
1 answer
78 views

Is Unity Built-in Render Pipeline the default option, which includes mobile/diffuse shader?

I have been using mobile/diffuse shader in my project for awhile. However, I am not yet familiar with the term "Built-in Render Pipeline". Is it true that "Built-in Render Pipeline"...
Job_September_2020's user avatar
0 votes
1 answer
82 views

Is it possible to prepare a generic bump map shader to be used by (injected at) any 3D game?

Is it possible to prepare a generic bump map shader to be used by any 3D game? I found this bump map shader: ...
Gussak Thor's user avatar
0 votes
0 answers
60 views

Need advice on how to implement grass shader similar to Breath of the wild

What I am trying to achieve : I’m trying to recreate the grass shader of Breath of the wild & Tears of the Kingdom. There is a glow on the edge of the individual grass blades present when the sun/...
Abhishek Jathan's user avatar
0 votes
1 answer
70 views

Normal map lighting is just slightly off

I've been trying to implement normal mapping into my custom OpenGL shader. The result I'm getting is almost there, but it looks like the Point Light is not ...
Tom Tsagkatos's user avatar
0 votes
1 answer
35 views

Is shader array shared with other shader or not?

The documentation for Material.SetFloatArray it states: Sets a float array property on the material. If a float array property with the given name already exists, ...
aaa's user avatar
  • 117
0 votes
0 answers
89 views

How do i make the terrain texture less repeating?

question in the title no more to add, don't say "but it depends on how you set up your project" cause i'll set up my project how i need to set it up to solve the problem.
Atsinganoi Dragon's user avatar
0 votes
1 answer
32 views

Can we use Universal RP shaders for some objects and Mobile shaders for other objects in a Unity scene?

I am sorry if this question sounds silly. But, I am new to Universal RP shaders, and have to ask this question. Previously, in my project, I had many beautiful objects that use Mobile shaders. Today, ...
Job_September_2020's user avatar
0 votes
1 answer
98 views

How does vector raised to the power of another vector work?

I was watching this tutorial and at timestamp 3:03 he did this: This blows my mind because I didn't expect that to actually work, how the heck does that work ???? For example, if I have vector (2, 3, ...
aaa's user avatar
  • 117
3 votes
1 answer
596 views

If UV coordinate is Vector2, then why does UV node in shader graph output Vector4?

I'm new to shader, so please pardon my lack of knowledge. I am trying to understand what does UV node do in shader graph. I tried searching on google and in https://docs.unity3d.com/Packages/com.unity....
aaa's user avatar
  • 117
0 votes
1 answer
102 views

Can’t understand what this shader is doing

I believe this is a fragment shader which is supposed to distort an image by creating a zoom and swirl like affect but I have no idea what the shader is actually doing ...
Kayla's user avatar
  • 107
1 vote
1 answer
138 views

What specific lighting property creates "the unity look"

Nearly all unity games have specific "unity" look. It is quite obvious that it is caused by the rendering pipeline and shading, but I was wondering which specific part is responsible for ...
Tribski's user avatar
  • 155
0 votes
0 answers
55 views

Pass texture array into shader and paint mesh vertices depending on vertexattributes

Well, I'm a newbie with shaders, I'm just trying to paint a mesh depending on the vertex attribute passed with one or another texture. The idea is to achieve this, for example: For this, I have been ...
z3nth10n's user avatar
  • 141
1 vote
0 answers
169 views

Use of a Global Shaders in Unreal Engine to apply some pre-processing operations

I'm a little experienced in Unreal Engine, but I don't know the Unreal's graphics programming from a very low level. More in details I would like to know how could use an Unreal's Global Shader to ...
Giuseppe's user avatar
0 votes
1 answer
450 views

How can vertex position can be converted to fragment position?

I started learning open gl and graphics programming for a while (im using open tk as im working on c#) so i finally came across lighting where you make the ambient diffusion. Im pretty sure that you ...
Alex Mathew's user avatar
0 votes
1 answer
61 views

Custom Shader leads to wonky clipping

I have a custom shader that will change vertex heights based on texture color. My big issue is that some areas of the mesh texture peek through when they should be hidden. What's going on here? plane ...
Jacksonkr's user avatar
  • 229

1
2 3 4 5
40