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

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

0
votes
0answers
27 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
16 views

UI Animation with shader move weakly

I want to animate UGUI vertex with shader like this: ...
0
votes
0answers
17 views

Unity Shaderlab: Pixel Perfect Distortion Shader that uses screen position?

So I am trying to make a distortion effect vertex-fragment shader! I am pretty new to shaders in general, and I am having some trouble with it. The effect is: from a distortion texture, I get a ...
0
votes
1answer
58 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
18 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
37 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
23 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
63 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 ...
0
votes
0answers
46 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
217 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
74 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
25 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
16 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
32 views

GLSL Shader compiles, but source is empty

I'm trying to compile a GLSL shader, to which I use the following code. Initialization ...
2
votes
3answers
251 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
42 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
31 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 ...
6
votes
1answer
242 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
26 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
60 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
81 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
23 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
61 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
39 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
40 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
0answers
10 views

Use Shader Graph break all materials?

I want use ShaderGraph in my game for first time. I installed pipeline and when I turn it on all materials turn pink "broken"!! What can I do to solve this ?
0
votes
0answers
63 views

How to play a material's shader in an image? (Unity 5.2.0f3)

I would like to obtain the same effect as in Seasons After Fall in Unity 5.2.0f3 for a 2D project: https://i.stack.imgur.com/WCIhs.gif Here the trailer, https://www.youtube.com/watch?v=cmAWybFKNh8 ...
0
votes
1answer
43 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
39 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
32 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
34 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
44 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
81 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
32 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
0answers
23 views

Unity C# - Apply a Shader to LineRenderer based on local coordinates of the LineRenderer

first of all: I'm a Unity Beginner, so i'm very sorry, if i'm asking a stupid or simple question. That being said here is my problem: I'm using Unity's LineRenderer to simulate waveform lines and ...
0
votes
0answers
17 views

What's the easiest way to apply a partially transparent shader to a section of an object at runtime in Unity3D?

In many games, projectiles leave a mark when they collide with objects. For simple cases, this is easy to implement simply by instantiating a partially transparent decal a small distance away from the ...
0
votes
1answer
39 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
0answers
56 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
55 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
29 views
0
votes
0answers
26 views

UNITY_UV_STARTS_AT_TOP seems not work on iPhoneX in Unity

I followed this blog's method to do an optimized projector in Unity, it's working fine on iPhone6/7/8. However, on iPhoneX its render texture inverses in y axis. So I followed this to fix it but it's ...
0
votes
0answers
17 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
0answers
6 views

iOS support for DepthTextureMode.DepthNormals mode

Does iOS support DepthTextureMode.DepthNormals mode in Unity? I have a shader for edge detection that uses DepthTextureMode.DepthNormals and it works fine on desktop but when I run it on iOS i dont ...
0
votes
1answer
58 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
0answers
29 views

Unity image effect - how to reduce or fix aliasing

I followed this tutorial Link to create a camera depth based gradient fog image effect. The author on the site warned about possible weird aliasing and I'm wondering what could be done to improve the ...
0
votes
1answer
53 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
15 views

UnityObjectToClipPos - returns -1 -1 clipping coordinates for 0,0 position

I've got a question regarding UnityObjectToClipPos Let's suppose I have Camera at 0,0,0 position and some point at 0,0,3. As this point is on the central axis of camera I expected that xy clip ...
0
votes
1answer
48 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
44 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
19 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 ...