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
35 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 ...
DannyNiu's user avatar
  • 111
0 votes
0 answers
73 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 ...
Basic's user avatar
  • 1,228
1 vote
1 answer
94 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 ...
armagedescu's user avatar
1 vote
0 answers
41 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: ...
groszobquivousemmerde's user avatar
0 votes
0 answers
37 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" ...
Sergiu Priboi's user avatar
0 votes
0 answers
25 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 ...
John Smith's user avatar
  • 1,255
0 votes
0 answers
37 views

Blending/gradient/smoothing between textures in Texture2DArray in HLSL shader

Well, I have this triplanar shader: ...
z3nth10n's user avatar
  • 141
0 votes
1 answer
28 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 (...
WestMansionHero's user avatar
0 votes
0 answers
30 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
52 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
28 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
1 vote
1 answer
59 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
  • 21
0 votes
0 answers
30 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
127 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
52 views

Custom matrix structure with OpenGL shaders

I have a MAT4 structure. ...
Valtsuh's user avatar
  • 139
0 votes
0 answers
143 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
34 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
33 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
140 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
56 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
88 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
34 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
38 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
27 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
54 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
110 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
69 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
81 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
134 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
90 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
174 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
35 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
74 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
190 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
131 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
42 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
72 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
75 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
142 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
87 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
27 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
83 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
83 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
63 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
72 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
  • 127
0 votes
0 answers
93 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
33 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

1
2 3 4 5
40