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
43 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'...
2 votes
2 answers
1k views

How can I create a shader which makes an object transparent in bright light and opaque in low light?

I'm trying to set up a shader that, as the title says, functions similarly to the effect appearing in the "Lights Out" horror short film. Cut down to the very basics, I'm looking for advice ...
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
1 answer
10k 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
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/...
2 votes
1 answer
2k views

Change alpha value of object if it's closer to the camera than the player

Ok, so - I'm a complete idiot when it comes to shader programming, and while I suspect someone with some experience here may find this easy, I'm at a bit of a loss. I'd like to create a shader that ...
2 votes
6 answers
4k views

How can I run a shader over the entire screen without interfering with other running programs?

How can I run a shader over the entire screen without interfering with other running programs? Specifically, I'd like to adjust the screen output with usability tweaks for my severely colorblind ...
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 ...
0 votes
2 answers
523 views

How to convert from object space to clip space

I want to animate foliage with vertex animation but I have wrong output because I can't correctrly transform from object space to clip space, and my foliage goes off the model. How Can I convert in ...
1 vote
2 answers
462 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 ...
0 votes
0 answers
749 views

Correctly Implementing SSAO

I am trying to implement Normal-Oriented SSAO and i'm having an issue with the results. Portions of the screen are inverted/wrong, typically half way through the screen but not always, it seems tied ...
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
31 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
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
35 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 ...
1 vote
1 answer
100 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?
1 vote
3 answers
2k views

Is wireframe effect possible without geometry shader?

I am trying to write a shader that highlight the edge between each pair of vertices, much like the UCLA Wireframe Shader. All implementations I came across require geometry shader support. I am ...
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
56 views

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

Well, I have this triplanar shader: ...
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 ...
1 vote
1 answer
839 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 ...
4 votes
2 answers
5k views

What makes a shader function with a LineRenderer?

A LineRenderer has both Material and Color properties. But many shaders do not work, ie the line will not respect the Color property, or the line will show black (regardless of the materials having ...
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 ...
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: <...
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 ...
0 votes
1 answer
3k views

Making a crosshatching effect in Unity Shader Graphs

I'm learning Shader Graph and am trying to experiment with toon shading effects. One thing I'd love to do is make a traditional art styled crosshatching effect either inside shadows or at the edge of ...
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. ...
1 vote
2 answers
184 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
233 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
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
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
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 ...
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
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
39 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
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 ...

1
2 3 4 5
41