People who code: we want your input. Take the 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
1answer
52 views

Unity: Alpha and color issues with opaque projector/decal shader

I have been attempting to make a simple "overwrite" version of Unity's projector shader. I can either respect the color, or respect the transparency, but not both. I have simplified the ...
1
vote
0answers
29 views

How to fix shadow not casted to terrain when rendering using default and terrain shader (depth shader included)?

Given that I have the TerrainShader class and DefaultShader class. Also a FBO (Frame Buffer Object) shadow map The ...
0
votes
0answers
21 views

View space positions from depth in DirectX

I have a depth texture and I'm trying to output the view space positions on the screen. In renderdoct I get the following image, and there are two 3D Models a plane and another model. I'm using an ...
0
votes
2answers
166 views

How can I draw orbit paths for a solar system?

I’m trying to make the orbital paths visible for my solar system simulation game. I have most around with trail renderers and solid line sprite but not achieving the desired look I want. I’m hoping to ...
0
votes
1answer
13 views

OpenGL translation based on “scaled” pixels? (Not physical pixels)

My (2D!) game runs in a “scaling mode” so to speak, and I’ve yet to find anyone asking this question anywhere. Basically, I want to achieve a sort of “scaling algorithm” whether graphics are ...
0
votes
1answer
18 views

How to use Texture2DArray with Normal map and Normal Unpack node in Shader Graph

I am extracting Normal Map from Texture2DArray in shader graph and then converting it to normal using ...
1
vote
0answers
7 views

Unreal Engine 4- Post Processing material isnt working on different viewports except perspective

I would like to render a silhouette of models, I found stencil would be the best way to capture. But when I am working with stencil post-process material its does not work with other viewports except ...
0
votes
1answer
3k views

Using ShaderGraph for UI elements with transparency

I am trying to design some UI elements using shader graph. In this case specifically a lifebar that is transparent where empty. For a normal lifebar with a filled and empty color I got it working ...
1
vote
1answer
38 views

Difference between ComputeBuffer and GraphicsBuffer in Unity?

At first I thought that ComputeBuffer's could only be used in compute shaders and that GraphicsBuffer's could only be used in ...
0
votes
0answers
27 views

3D Cartoon Graphics. Default Materials in Unity, Maya, Blender etc. Do I need to learn shader coding? [closed]

If there was a Stack Exchange for CG, I would post there instead. But since there is not and I know there are a lot of knowledgeable and very helpful people here, I thought I might save a lot of time ...
1
vote
1answer
344 views

URP cant get Pixel Perfect Camera to work

I am currently using URP to add bloom to my particlesystems. The problem im facing is that I cant pixelate the game. I have tried to implement several methods to post pixelate (via shaders and render ...
0
votes
1answer
5k 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
1answer
109 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
1answer
46 views

How to use an overlapping shader so that it uses layers sort from sprite renderer and its transparent

Im using the shader from question , but once I put it in the game, and my character gets close to it, it will be hidden by the shadow of the tree, which is transparent. Any way to make the shader ...
0
votes
1answer
49 views

Need help getting an objects orientation / all my OpenGL rotations are reversed

I'm using OpenGL on Ubuntu Linux with the Eclipse IDE and the GCC compiler. I am bringing blender models into a homemade renderer/game engine. I parse a text file containing object descriptions to ...
5
votes
1answer
811 views

Invert the colour of pixels where 1 bit sprites are overlapping

I have a simple scene in Unity that makes use of some simple art that uses either white or transparent colours to create a 1-bit art design. The image below shows this. I want to have a that if two ...
1
vote
2answers
149 views

How to hide player when in Shadow using Unity 2D Light System?

I have been looking for this for a couple of days now and cant find an answer; how can I hide a player when they are in the shadow when am using Unity 2D Light System? I know I can choose not to cast ...
0
votes
0answers
10 views

Attach a DXR state subobject to a library using the DirectX Shader Compiler

Suppose I've got two IDxcBlob's libraryBlob and localRootSignatureBlob obtained from calling ...
0
votes
1answer
23 views

Unity Texture2DArray is too noisy

I've generated a Texture2DArray from array of Texture2Ds and for some reason, when my shader is using Texture Array the output ...
0
votes
1answer
69 views

Can geometry grass shaders be painted to a terrain or are they limited to meshes?

So I was follow the roystan grass shader tutourial and although it works well I don't understand the use for it. From what I understand the shader is basically just a flat plane that calculates grass ...
0
votes
0answers
23 views

Converting Shader to ShaderGraph for URP conversion

I know there are a bunch of threads asking for help with converting old shaders to ShaderGraph, and this one is no different. I spent a lot of time trying to get a shader to cast shadows from sprites ...
53
votes
1answer
37k views

How do Raymarch shaders work?

I have been looking at shaders found here shadertoy.com and most of the cool ones have noise and raymarch in common. I do not understand the source code at all but I really want to. How do these ...
6
votes
3answers
2k views

How to handle multiple effect files in XNA

So I'm using ModelMesh and it's built in Effects parameter to draw a mesh with some shaders I'm playing with. I have a simple GUI that lets me change these parameters to my heart's desire. My question ...
3
votes
1answer
574 views

Full screen shader causes performance hit

I basically want to have a shader run that can do something like toon shading, or grayscale the whole screen, or radial lighting. To do this, I create a new bitmap each time the display resizes that ...
0
votes
1answer
18 views

How to best select a texture pair to use in height blending when using a splatmap shader

In my project, I'm implementing a shader to combine up to 4 textures in a terrain using a splatmap texture (https://en.wikipedia.org/wiki/Texture_splatting). I want to combine the splatmap blending ...
1
vote
4answers
1k 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
0answers
13 views

Rotating UVs by X degrees

I would like to make a tileable texture with UV noise in Unity Shader Graph only, but I have a problem. After creating simple noise from UV, I want to rotate it by 90 degrees, but the node ...
0
votes
0answers
19 views

How many texture units are available per shader stage when compared to the total number available on hardware?

The answer to the question How many textures can usually I bind at once?, given here, explains that: OpenGL 3.x defines the minimum number for the per-stage limit to be 16... and that there can be a ...
0
votes
0answers
12 views

Updated Unity project from 2020.2.1f to 2021.1.7: lighting is messed up, scenes are brighter

I've updated my project from 2020.2.1f to 2021.1.7 (also tried 2020.3.8), and now my scenes are much brighter for some reason: Any tips? Current I use the standard pipeline I think, because the ...
0
votes
2answers
2k views

Limit Color Pallete Using Shader (Unity)

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 ...
3
votes
2answers
110 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 ...
0
votes
1answer
90 views

Passing touch position to compute shader

I am working on a game where I have to mix colored liquids as shown here. I am working with a plugin (StableFluids) to get this effect: Effect Problem: The shaders used in the plugin are able to ...
5
votes
2answers
411 views

Weird shader behavior on different devices

I'm trying to combine an ordinary shader with a Single Distance Field shader (for fonts and scalable icons) into one shader program. The idea is simple - if uv.x is less than 1.0, it is drawn as ...
1
vote
1answer
2k views

Moving/spilling water inside a cup of glass

I made a glass of water but there are somethings i didnt know how to do well, what i did is i put a mesh on the top of the glass to represent the surface of the water but it doesnt really work well ...
1
vote
2answers
100 views

How to use vertex and fragment shaders without using VBOs and VAOs?

Recently, I am trying to make a 3D game in LWJGL 2, not LWJGL 3, just because I am more familiar with LWJGL 2. Since LWJGL decided to shut down their legacy wiki website, I've been researching alot ...
0
votes
0answers
26 views

Tree batching problem in Unity

I have some problems with batching trees. I'm using the default unity terrain system and trees. My problem is that trees won't get batched together (I've set up static, dynamic, and GPU instancing) ...
0
votes
0answers
35 views

How can I roll up a plane like paper?

Hello, I want to twist the plane. The plane looks like this when I try to do it the way I linked below. How can I my plane roll like photos? How can I roll up a plane with a vertex shader? you can see ...
0
votes
1answer
21 views

Unity: Opacity over Distance with Surface Shaders

I want to tweak the alpha value based on the distance to the camera. But I see no way of passing the vertex position on to the surface function using surface shaders. Not a problem with frag shader. ...
1
vote
2answers
473 views

Overlap color between objects

I'm currently trying to build a game with Ogre3D that is basically a moving vehicle that leaves a green trail (2D manual mesh) in it's path, what i'm trying to achieve is exactly what this image shows:...
0
votes
1answer
853 views

LibGDX - Draw multiple textures with different positions with one shader?

currently I'm optimizing my render calls by drawing multiple textures with one shader. The background textures who all share the same position are no problem. But now I want to draw some Textures with ...
0
votes
2answers
229 views

GPU Gems Chapter 1, update normal

Had plans to follow GPU Gems to gain knowledge in Shaders - but my journey came to an abrupt end. ...
1
vote
1answer
393 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
1answer
81 views

Any fast alternative to sine in GLSL?

Should I just use the built-in sin() function or my custom sine function? I'm concerned about performance here. I don't care about accuracy much here because I use it to just get wave effects in my ...
0
votes
0answers
26 views

How can I achieve this “stroked lines” effect?

I have a collection of arbitrary vertices and edges that are connected, but which do not necessarily form triangles. These vertices and edges mostly fall along a flat plane, but have some height ...
1
vote
1answer
128 views

How can I write an additive mesh shader that splits the RGB channels while accounting for depth?

I'm trying to create a sort of "hologram" effect. So far, what I have is an additive, three-pass shader that uses ColorMask for each pass to separate the RGB channels. The problem is that doing so ...
0
votes
0answers
48 views

How can I optimize this blur shader?

I'm trying to do a bit of shader development. I found this optimized version of gaussian blur (shadertoy demo), rewrote it in ShaderLab:: ...
0
votes
1answer
91 views

using a wire-frame shader on a plane how can i also fill in the squares with a solid color so that each square's color can be changed?

I'm not sure if using a shader is the best way for what I'm trying to achieve, but I would like to apply a color to each of the squares like in the picture and have the ability to change each color ...
2
votes
1answer
2k 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
0answers
39 views

How to texture procedurally generated custom terrain mesh

I am making an infinite procedural terrain for my game and currently trying to apply textures to it. The generated terrain has different biomes, so I want to texturize the terrain based on biome and ...
27
votes
4answers
63k views

Fastest way to draw quads in OpenGL ES?

I am using OpenGL ES 2.0 I have a bunch a quads to be drawn, would love to be able to have to pass only 4 vertices per quad as if I were using GL_QUADS, but basically I just want to know the best way ...

1
2 3 4 5
36