Stack Exchange Network

Stack Exchange network consists of 175 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

0
votes
1answer
21 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
64 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
84 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
72 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
64 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
53 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
65 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
vote
0answers
29 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
152 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
283 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
31 views

Performance of static const variable in shader

I am using static const variables based on uniform variables. For example: ...
0
votes
1answer
90 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
1answer
123 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 ...
1
vote
0answers
84 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
103 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
182 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
46 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
172 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
111 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
55 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 ...
0
votes
0answers
59 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
175 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
48 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
179 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
225 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
113 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
1answer
171 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 ...
3
votes
1answer
303 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
vote
2answers
410 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
191 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
62 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
21 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 ...
0
votes
1answer
39 views

GLSL Shader compiles, but source is empty

I'm trying to compile a GLSL shader, to which I use the following code. Initialization ...
4
votes
3answers
291 views

Are there technical reasons to use short variable names in shader code?

I have been reading and writing both GLSL and CG for the past few years, and have noticed a trend. In programming, we are generally advised to be as meaningful and concise as possible with variable ...
0
votes
1answer
60 views

GLSL - Efficient Point inside Box Check

I'm attempting to improve the performance of a shader that changes the colour of a region of the world that is inside a "zone". I am using a deferred lighting system, so the colour and world-space ...
0
votes
1answer
42 views

Unity - Adding a sphere volume to this shader

I'm trying to create a spherical effect around my player that when they walk into range of hidden object, it gradually renders the object. I found a shader that would work pretty well for this. When ...
8
votes
1answer
365 views

How can I implement a revealing light beam?

In SEARCHLIGHT, you control a ray of light that illuminates incoming enemies that are otherwise invisible in the night sky. Here is an illustration: How would I go about doing this, preferably in ...
0
votes
0answers
44 views

How can I add recieve shadow to my transparent shader

I need a shader with these features recieve shadows transparency (changing alpha for fading) Cutoff (alphatest cutoff) this is my shader: ...
0
votes
1answer
254 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 ...
0
votes
1answer
175 views

Make a glass cup look like it's full of water

I've been struggling to figure out a way to make a glass cup full of water, and since the cup is made of glass a plane on the top of the glasse won't really do it, so how can i go around making the ...
0
votes
1answer
196 views

Unity Manual Instance Example Shader contains errors

The Unity Manual has a page on GPU instancing. One of the examples, titled "Adding instancing to vertex and fragment Shaders", causes the following errors to printed to the console when saved in a ...
1
vote
1answer
123 views

OpenGL Deferred Shading Pixelation

I'm working on a 3-pass deferred lighting system for a voxel game, however I am having problems with pixelated lighting and ambient occlusion. The first stage renders the color, position and normal ...
1
vote
1answer
45 views

How to implement multicolored flashing sprite effect like in Contra and the Messenger?

I want to implement an effect similar to what you see in this clip of Contra. When the boss takes damage, he flashes wildly with different colors. A similar effect can be seen in this clip from the ...
1
vote
0answers
109 views

How can I blend meshes together where they intersect?

In a lot of my scenes I have things like this: and this: All the places I've circled are places where a prefab overlaps with another one or with the terrain. Is there any way to make those lines ...
0
votes
1answer
94 views

why my shader is black in the game mode?

I used this useful blending modes It's good but it just work in Editor mode. what is the problem?! ...
0
votes
1answer
77 views

How can I color single triangles with a color palette?

My primary goal is to have a lowpoly rendering style, so that each triangle has its own homogeneous color on all its fragments, meaning color is not interpolated between vertex. I have my indices ...
0
votes
2answers
66 views

2D Camera Movement Temporal Reprojection

Having an Orthographic Camera with its View Projection Matrix given from the current and last frame, how to reproject the previous frame to the new one?
0
votes
1answer
54 views

How can I ensure my Direct3D 11 shader scripts are not visible to the user?

Right now for my engine, I rely on pixel and vertex shader script text files that I load and compile when I need them. What I am wondering is, how can I store the shader scripts so that they are not ...
1
vote
1answer
128 views

Rain Effect generation in a Unity VR project

I´m developing a VR project in Unity Engine and I need to implement a Rain Effect. I have considered the following: A VR game must run at least 90 frames per second. The Rain must be detailed. The ...