Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
22 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
107 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
42 views

Custom matrix structure with OpenGL shaders

I have a MAT4 structure. ...
1 vote
2 answers
104 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 ...
0 votes
0 answers
52 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
22 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
30 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
0 answers
50 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
84 views

Assigning Color Won't Work

I am trying to make a palette-swap shader. Here is my code: ...
0 votes
1 answer
4k views

Using ShaderGraph for UI elements with transparency

I am trying to design some UI elements using shader graph. In this case specifically a life bar that is transparent where empty. For a normal life bar with a filled and empty color I got it working ...
0 votes
0 answers
23 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 ...
1 vote
2 answers
4k views

Shader FloodFill Alogrithm

I'm new to openGL and shaders. Is there a way to implement shader algorithms for floodfills? Basically, I have a picture with outlines and i want to fill the insides of where the user touches it
0 votes
2 answers
4k views

Limit Color Pallete Using Shader

Basically, what I want to do is take a primary input image texture (which is a render texture in-game) and a secondary pallete texture (contains X number of colors, and is X by 1 pixels in size). What ...
0 votes
0 answers
36 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
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 ...
2 votes
1 answer
98 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
0 answers
38 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 ...
0 votes
1 answer
77 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
1 answer
79 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
48 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 ...
2 votes
1 answer
3k views

Unity procedural skybox shader texture stretching

I am using the procedural skybox shader that Unity provides, but have tweaked it so that I can have a cloud texture. The problem I have, is that the texture is not tiling correctly, even though it is ...
0 votes
0 answers
95 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 ...
2 votes
2 answers
2k views

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 ...
0 votes
0 answers
66 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 ...
1 vote
2 answers
454 views

Particles not rendering over projectors

I am using projectors for shadows...When I use particles for bike speed up i.e., nitro speed the particles get cutout by those shadows.... Here is screenshot of it, Here is my shader code of ...
2 votes
2 answers
128 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
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 ...
0 votes
1 answer
418 views

opengl (lwjgl) - only white triangle gets rendered, vertex and fragment shader not responsive

Currently my program can only render my vertices as white and changes in my vertex and fragment shader don't change what gets rendered for some reason i.e: (...
0 votes
1 answer
55 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
177 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 ...
1 vote
1 answer
508 views

Material Transparency is not showing in the build

I have came across a weird situation. I have a gameobject that has a standard shader material. The material rendering mode is set to Transparent. This is working fine in the Unity editor, but its ...
1 vote
0 answers
116 views

How do I add URP lighting reaction to the following handwritten shader?

I'm on Unity. I'm not very experienced with shaders nor shader graphs, but I managed to get this one to work on URP. What it currently does is, it takes noise values, and creates a tileset out of them....
0 votes
0 answers
87 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 ...
8 votes
1 answer
1k views

How do I make volumetric grass?

I've been extremely interested in volumetric technology, especially for grass. Online resources are extremely scarce on this topic. What is the difference from creating a lot of mesh billboards? ...
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 ...
7 votes
1 answer
1k views

Draw Edges in OpenGL

I use blender game engine and blender uses OpenGL for graphics. How can I draw lines around all 3D objects? Would this be a job for a filter? Mainly, I want my end result to look drawn. I found this: <...
2 votes
2 answers
495 views

How to render thin glass with proper refraction?

I want to render thin bumpy glass with refraction. But it offsets too much(look at the black frame of the glass). Looks thick. How to do thin glass refraction properly? Or is it possible to exclude ...
1 vote
1 answer
63 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
57 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 ...
1 vote
1 answer
709 views

No vertex shader bound at draw?

I tried asking this on reddit but I didn't get any answers so I might as well try here So I'm making a program to generate some terrain and it's not giving me the results I expected. It's drawing ...
0 votes
1 answer
84 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 ...
1 vote
1 answer
106 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 ...
0 votes
1 answer
9k views

How to use a .mtl file in Unity?

I want to use a .mtl file to draw my objects in unity. Can I somehow convert a .mtl file into a normal Unity material? My .mtl file is like this: ...
0 votes
1 answer
438 views

Generating the distance of an intersection through a box from the camera in Unity C#

So, I recently saw this fantastic video by Sebastian Lague about planetary generation- https://www.youtube.com/watch?v=lctXaT9pxA0&t=1100s And I decided to replicate it, however, on a flat plane, ...
0 votes
1 answer
79 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: ...
1 vote
1 answer
2k views

How to position/transform vertices for 2D UI in shaders?

I am building a 3D engine and have a rendering abstraction that focuses on writing shaders. Most my 3D shaders have gl_Position output like: ...
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, ...
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 ...
0 votes
1 answer
73 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"...

1
2 3 4 5
40