Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [shaders]

a computer program that runs on graphics hardware and provides a high degree of control over how scenes are rendered

1
vote
0answers
13 views

Hard coded triangle in HLSL geometry shader doesn't show on screen

In Unity I'm planning on using a geometry shader for processing points into quads and can't quite figure out why I'm not getting output from my geometry shader. I've edited it down to a minimum ...
1
vote
0answers
19 views

Unity Shader: Make water on terrain transparent without fading

I want to create a shader for a terrain to make the water fully transparent but not invisible or faded. In this example I would want the purple square to be seen through water but not through the ...
2
votes
0answers
40 views

Trying to get Vertexshader to work Monogame 2D

If I don't use the vertex shader, it gives me white textures which is what the default color is. Once I add the vertex shader, the screen is black. I figure it is something wrong with the Matrices I ...
1
vote
0answers
25 views

Is there a way to set a shader define in Löve?

I know I can use shader:send() to change variables, but is there a way to set/change a #define?
0
votes
0answers
12 views

Blinking color shader

Currently i'm using Unity3D, and i want to make one variable blink along time in a fragment shader. Now i have code like this: ...
0
votes
1answer
19 views

Setting shader by script?

I make s shader file and drop it on object with material. I wrote this script to run shader when press Space button. All is good except that script not load shader when run the game !! I have to do it ...
0
votes
1answer
25 views

Godot: error(10) expected '(' after Identifier

When trying to write up a new shader for a material, I've been trying to create a variable to use to alter speed and test animation. Now, the below outputs fine until I try to assign a value to number....
0
votes
1answer
50 views

How can I transform a world space point to a camera's screen coordinate?

I'm trying to transform a point in fragment shader from world space to screen coordinate of a second camera. Not the main one. I think I know how to achieve that to the main camera, but I'm ...
0
votes
0answers
24 views

Adding drop shadow to text in Minecraft

I would like to know how to take a text object rendered using the default Minecraft font renderer and add a drop shadow behind it. I believe what I need to do is make a copy of the text object, ...
0
votes
0answers
24 views

How I can create HQx or xBR pixel art upscaling shader in GLSL?

I want to make an image scaling shader in OpenGL Shader Language... but I have no idea how to make it. I want to implement either the HQx algorithm or an xBR variant. My game engine is GameMaker: ...
0
votes
0answers
22 views

How to make plane thick with shader in Unity?

I use plane as wall, door,... using Double Sided Shaders. I just want to make my wall, door,... thicker so it doesn't look like paper, I don't need to make it look super realistic. I wonder if I can ...
0
votes
2answers
57 views

Shader vs Working with Pixels

I am working on 2d games only. In that context, when would I ever need to use a shader rather than simply manipulate the pixel-data of an image? For example, I have an image of a car and I want to ...
-1
votes
0answers
15 views

Post-processing shader using 3D pixel coordinates to dictate colour

I am trying to make a post-processor shader within Unity which I cannot quite crack. Essentially I want to make a post processing shader that finds the 3D world coordinate of its associated pixels, ...
-1
votes
0answers
18 views

Vulkan creating shader module from spirv generated with -fhlsl_functionality1 flag

Whenver I compile the shader with this flag for semantic reflection and I try to create a module from it I get this error: ...
1
vote
0answers
21 views

Why is the clear coat second normal disabled by default?

As described here, in order to set up a clear coat material with normals for both layers in Unreal Engine 4, it is first necessary to enable this feature in the project settings: Why is this not ...
1
vote
0answers
41 views

Unity blit() not writing to RenderTexture

I found a nice Gaussian Blur shader online and am attempting to use it to blur a render texture using blit(). However, the render texture remains unblurred. I know for a fact the blur shader works as ...
0
votes
1answer
44 views

How to add emission to texture in shader?

I want a texture to emit itself by 1, not more. In Standard Shader I enable Emission and set texture to Color and Color to 1. I don't need emission to go beyond the object, I only need the texture to ...
0
votes
1answer
26 views

Creating materials in modeling program vs in Unity: when to do either?

This is something I should know the answer to by now, so I'm asking to clear up the gaps in my knowledge: As I (re)learn about shaders, specifically in relation to Unity, I see all sorts of ways to ...
0
votes
0answers
26 views

Performance of static const variable in shader

I am using static const variables based on uniform variables. For example: ...
0
votes
1answer
51 views

Why do I get an unexpexted token error while compiling this shader?

I get the following error syntax error unexpected token vertex I am still learning shaders so I can't really understand the reason for this error. How can I make this shader work? ...
0
votes
0answers
25 views

Unity apply materials to parts of a mesh

How can I apply materials to a part of a mesh in Unity ? As an example I would like to place grass on the first half of a plane and rocks on the second. And if possible, how can I manage transitions ...
0
votes
1answer
60 views

Texture Atlas and HLSL Shader for sprite tiling

I am trying to create a shader that allows to tile a specific region of a texture. This seem to be a common need however I can't seem to find any information about how to get this effect done. The ...
0
votes
0answers
21 views

Raytracing infinite hair strand in modulo space (curly version)

I'm working on a hack for hair rendering, I basically trace modulo voxel to get infinite grid intersection. It's basically a division from the entry point to the hair center using the delta of the ...
1
vote
0answers
76 views

How can I make Matrix Rain?

I want to make 3d Matrix rain like this shader that you can rotate camera.I tried to convert this shader but It have many calculations that it's expensive inside game engine.then I tried to make this ...
0
votes
1answer
59 views

DirectX 11 Compute Shader error DXGI_ERROR_DEVICE_HUNG

I am trying to use a compute shader for ray picking technology. My shader accepts: vertex buffer of all models index buffer of all models a buffer of transformation matrices of all models Offset ...
0
votes
0answers
69 views

Don't Render always on top Unity world space canvas UI

I have a World Space Canvas where I have a text object which is always rendering on top. I checked that it has UI/Default Shader attach. Is there any way available ...
1
vote
0answers
39 views

Artefacts in SSAO Shader

I am having trouble with my Screen Space Ambient Occlusion shader. The objects in the game have the correct occlusion applied to them, however the occlusion flips depending on the angle of the camera:...
1
vote
1answer
150 views

How do I make my glsl RGB displacement map look like this

I want to use a RGB texture as described in this video here. Here is my texture so far. The author says the first line has no R channel and ranges from B = 0 to B = 255. While each other line has R ...
0
votes
0answers
59 views

How to get Pixel Coordinates of certain colors in a Texture?

I have a relatively big Texture, and I try to find a certain color pixels pattern: eg. White, Black, White, Green . They are lying next to each other, If I use Texture2d.Getpixels() on every pixel ...
0
votes
2answers
45 views

Extracting individual components of a vector in the Source Shader Editor

I'm using the Source Shader editor and would like to mask a vector output to one or two values, yet there is no existing mask node, as far as I can see. What HLSL code should I use to output what I ...
-1
votes
0answers
58 views

Is the GPU's texture memory cache cleared when reading from multiple textures?

I have been reading lately about the memory layout of graphics cards and the issue with dependent texture reads. I am worried about the efficiency of the way I use framebuffer textures. Initially I ...
0
votes
0answers
53 views

How to create a shader for this hue change effect?

In this cut scene from Shovel Knight, the individual pixel art tableaux don't merely fade in and out. Rather, they fade in and out as well as undergo various hue changes. Here's an example: The ...
0
votes
1answer
83 views

Multiple Colour Gradient Lerp

I want to return a colour for a position t, given an arbitrary number of colour stops - a stop is comprised of a position, and a colour. Like selecting a colour from a multiple-colour gradient, ...
1
vote
1answer
32 views

What does vertex:disp and tessellate:tessEdge mean? [Shader] [Unity]

I came across the following declaration on unity tutorial #pragma surface surf BlinnPhong addshadow fullforwardshadows vertex:disp tessellate:tessEdge nolightmap ...
0
votes
0answers
15 views

Exporting Terrain Heightmap from Unity is black

For a current project I need to export my terrain's heightmap to pass the height information to my shader. When I use the "Export Raw..." feature under terrain settings, I get a black image. What am ...
-1
votes
0answers
23 views

Unity3D: Mask on Animated Shader

Regarding the answer in this question: Animated textures for models; How to write a shader? I'm trying to use it together with a masking shader, but it doesn't come out with the result that i ...
0
votes
0answers
55 views

How can I convert 3D mesh to SDF?

Previously, I found an useful article that explained how to convert 3d mesh to SDF easily. I want our artists to be able to easily convert from polygonal data to SDFs with little-to-no effort. ...
1
vote
1answer
152 views

Rendering clouds similar to Sky: Light Awaits?

I'm interested in adding clouds to my game, with a style similar to those in Sky: Light Awaits You can see them in motion in these videos: (Starts at 26:00) https://www.youtube.com/watch?v=...
0
votes
2answers
102 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. ...
0
votes
0answers
31 views

UI Animation with shader move weakly

I want to animate UGUI vertex with shader like this: ...
0
votes
1answer
122 views

HLSL float bitfield

In HLSL I want to store a bitfield for each color in a texture. Specifically spanning 3 floats (RGB, not alpha). Since each float has to be between 0 and 1 I can only use the significand/mantissa of ...
0
votes
0answers
21 views

How to QUICKLY make material from images in Unity?

Ok for these years Ive made materials from exported texture images by 1. importing the images 2. make a material 3. Manually drag each image into its slot in the material There must be a faster ...
0
votes
0answers
76 views

2D Lighting Shader Multiple Lights

For a 2D platformer, I have a 2D lighting shader with two passes, the first one draws a shadow from the closest light to the sprite and the rest of the lights will reduce the visibility of the shadow ...
0
votes
0answers
31 views

Using a light mask overlay without lighting the sky

I'm using an overlay to create a lighting effect in a 2D game. The overlay is a grey-scale mesh and I multiply each pixel of the mesh with the pixel already written to the framebuffer. This works ...
2
votes
1answer
168 views

How to implement a pixelated screen transition shader?

I am interested in creating a screen transition seen in a lot of retro games. The transition is just a kind of pixelated distortion that increases or decreases in granularity over time. The effect is ...
-1
votes
0answers
54 views

Weird behaviour of glsl with fragment, vertex and geometry shaders

I am a beginner in developing games. I started some time ago with OpenGL and the glsl language. These days I am having so many problems and for me it is too difficult to solve, because the shaders are ...
1
vote
2answers
293 views

2D Blizzard/Snowstorm Effect

How can I implement a blizzard/snowstorm effect in a 2D platformer? I have a particle system for snow particles, but I need some kind of windblown texture similar to this as well: How do I create this ...
0
votes
1answer
106 views

How can I write a dots effect shader when the character is behind an object?

I watched an interesting effect while I was playing Super Mario Odyssey: when Mario or another character was behind an obstacle (walls, etc), a tiny gray silhouette mesh appears. I tried to build ...
0
votes
1answer
40 views

Using multiple textures in Monogame HLSL Effect shader?

My Monogame HLSL shaders only successfully sample one texture (besides the screen). Any additional textures I try to sample end up with the same texture data as the screen. I've found people with ...
1
vote
0answers
17 views

Transparency problem / Expanding material fixes it magically?

i stumbled upon a problem, can't figure out what's the reason and how to solve it. I have glass-windows which use just the standard (specular setup) shader. in the first place when the model is added ...