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
0answers
170 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
73 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
72 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
261 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
75 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
342 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
402 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
135 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
260 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 ...
2
votes
1answer
399 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
517 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
264 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
102 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
22 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
44 views

GLSL Shader compiles, but source is empty

I'm trying to compile a GLSL shader, to which I use the following code. Initialization ...
3
votes
3answers
323 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
78 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
47 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 ...
7
votes
1answer
463 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
85 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
453 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
207 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
301 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
164 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
47 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
158 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
133 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
89 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
76 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
64 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
167 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 ...
0
votes
2answers
386 views

Unity 3d texture animated round circular bar

I'm struggling to create a circular bar with an animated texture and a round cap end. What I would like to create is implemented in the Unity game Subnautica - the bottom left bar. So here is the HUD ...
1
vote
1answer
58 views

Why does my terrain texture fail to load? (OpenGL)

I'm currently using a vertex shader and a fragment shader for loading my texture onto the terrain I made. Here is my vertex shader ...
0
votes
1answer
184 views

Glow effect shader for mesh generated at runtime

I'm using the leap motion-paint module and i would like the ribbons that are generated at runtime to have a glow effect, I tried editing the existing shader by adding a glow property but the colors ...
0
votes
1answer
221 views

Water cut off effect in UE4

Working on a side scroller game in Unreal Engine 4 and I need to create a water cut off effect like seen in the screenshot of Ori and the Blind forest. Basically need a side perspective on water ...
1
vote
1answer
118 views

Low fps on Arm Mali GPU

I was trying to google and understand my problem in two weeks but i am defeated, so i am asking for help. The main problem is that my custom unlit frag shader after certain amount of time on devices ...
0
votes
0answers
54 views

Cascading Shadow Maps - Spotlight Projection

In all the cascading shadow map explanations I have read, the final projection into the shadow-map is done using an orthographic projection. This makes sense for a directional light because a ...
0
votes
1answer
190 views

Why does Unity heavily blur edges of a single cube despite 8x antialisaing

I was messing around a random project and everything was working perfectly, when all of a sudden jagged edges appeared on all objects. I've been trying to resolve this issue for the past two dails, ...
0
votes
1answer
96 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
1answer
268 views

Unity run-time creating material has performance impact?

Just found creating a material in a script for the first time would have performance impact. (Using Unity 5.6.5f) A very simple script for testing is to create a game object with MeshRenderer in ...
0
votes
2answers
667 views

What's the difference between length function and distance function in Unity Shader?

I'm confused about the two functions, do they return the same thing?
0
votes
1answer
56 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 ...
1
vote
1answer
154 views

Unity: How do I only show parts of objects that overlap [2D]

I'm working on a 2D Unity project where the player can only see objects in their field of view. I have successfully created a mesh that overlaps anything that would be in the player's field of view, ...
1
vote
1answer
122 views

The number of shaders a large game or game engine has

Wondering the scale basically. The number of shaders a large game or game engine has. I've seen some metal repos but they typically just have 1 or 2 shaders for small demos. I think I've seen a few ...
3
votes
2answers
394 views

How can I add a glow effect around a pair of wings in Unity without post processing?

Basically I want to use post processing and then I found a tutorial to achieve my goal. However, the artist want a pure shader to achieve this, without any C# script hanging in the main camera. Any ...
0
votes
1answer
902 views

Unity: Water shader vertex offset - how to add mesh collider which updates with vertex offset?

I have written a shader (in the new LWRP shader graph) which simulates an ocean with vertices which offset to create a moving "waves" effect. I believe that in order to have objects "float" on my ...
1
vote
1answer
64 views

How to organize passing data to shaders in cross-API render system?

I try to create rendering system that supports DirectX and OpenGL. I am trying to create class for constant buffer, but DirectX constant buffers and OpenGL uniform buffers have different memory ...
1
vote
1answer
550 views

How to access an uniform array with a float as index in GLSL?

I'm trying to do basic multitexturing of terrain in OpenGL. Im building the terrain with an image representing different elements (beach, water, jungle...) : Im trying to map each color of this ...
1
vote
1answer
18 views

Normal doesn't appeared on shadow/dark area in Mobile Shader

Let's look at this picture: You can see the red rectangles, those are shaded by normalmap. Here, is the same model with different light angle, there's no normal shading in dark area. It only ...
1
vote
0answers
66 views

Custom Transparent Shader rendering order is wrong on iOS

In Unity Engine, I wrote a custom transparent shader(I use blend to achieve) for crystal effect and it's totally fine on Windows. However, when it's on iOS platform, the crystal always culls ...