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 [shaderlab]

The tag has no usage guidance.

0
votes
1answer
28 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
2answers
89 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
60 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
0answers
43 views

Unity shader pixelated on Android/ WebGL

I'm writing an image effect shader that should display an overlay texture on the screen using the following code in the fragment function: ...
0
votes
0answers
50 views

Half-shaded pixel artifacts on 2d dynamic lighting shader

I'm working on a shader for dynamic lighting in a 2 unity game. I'm new to shaders but I've managed to get something close to the effect I was looking for, although not 100%. As you can see in the ...
1
vote
2answers
368 views

How can I make a shader that will make a cube or any object invisible?

I'm trying to create a shader that will make the object invisible and then with a script a fade in/out effect between invisible and visible. What I tried: ...
0
votes
0answers
56 views

Change something that affects everything under -Y value to use normal orientation instead

I'm starting to get a grasp of shaders and I have this one from here and would like to modify it so that instead of just affecting the area under a specified Y value it can be depending on how the ...
69
votes
1answer
7k views

How can I make a “wet surface”/“shallow puddle” shader in Unity?

In my game I need to create dynamic water puddles but I cannot find a tutorial that shows how I can make such an effect (an example of which is shown below). How can I do it?
0
votes
1answer
763 views

How can I fix my shadow caster problem?

I'm trying to make invisible object with shadow by using it's shadow castting pass it additionaly shades back side of object itself. I mean object shades his back side and draws shadow on the ...
7
votes
1answer
1k views

Moving texture according to position in shader

Divinity Original Sin have beautiful particle effect , When I move around game I see galaxy through particle that move according to my position.how can I make like it? you can see this effect here: ...
8
votes
2answers
1k views

How can I make natural rain drops on screen?

I'm trying to make rain effect drop with metaballs and trail on screen.I find a clue in shadertoy but I didn't understand how implemented: https://www.shadertoy.com/view/ltffzl unfortunately it have ...
0
votes
1answer
268 views

how can I make delay in shader?

my effect is loop but I need have delay between each flash effect.i don't want use c# code because i believe there is easy way to implement delay in shader. ...
1
vote
0answers
87 views

How can I rolling plane by vertex shader?

I have plane that i wanna roll it by vertex shader like this: https://www.desmos.com/calculator/mrfrugwvm5 this is my shader: ...
1
vote
0answers
210 views

How to create inline glow shader for 2d polygon in CG using Unity Shader Lab?

So here is what I am trying to do. Given irregular polygon (on the left) I would like to be able to create a shader that would resemble Photoshop inline glow effect with opaque fill (on the right). ...
0
votes
0answers
347 views

How to make a custom GrabPass-like sampler2D in MRT shader in Unity?

I only know the basics of writing shaders, so I don't have a clue how I can make something similar to Unity's Grabpass in that a RenderTexture that is currently write only, can be changed to readonly ...
0
votes
0answers
54 views

How can I Increase pixel In rendering my shader?

This is my flow map shader , it works correctly but I have problem In Rendering. how can I Increase pixels per unit In my shader? ...
0
votes
1answer
456 views

Accessing vertex Input in surf directly without vert's out parameter In Tessellation Shader

I can get the vertex Input in vertex shader as follows: o.worldPos = v.vertex.xyz; But how do I get the worldPos directly without filling the out parameter in ...
1
vote
0answers
79 views

how can I add animated shadow on my flag?

this is my flag: I need to adding shadow effect on my animated flag like below image but I don't know how can I do this: here is my shader: ...
2
votes
1answer
59 views

How to draw texture with unlit effect on surface base texture

I am writing a shader to my Unity game and I want to have effect this type of effect: Base texture, for example, skin of character is a texture that will use shadows, lighting. Second texture, unlit, ...
7
votes
1answer
400 views

How can I make custom character face editor In my game In an optimal way?

In many games there Is section as customize character that you can make your own character.I always love to know how can I make something like It. Even old game have this feature? but how ? For ...
7
votes
1answer
223 views

Why does duplicating my object cause its vertex animation shader to distort it?

I used a vertex shader (based on this example) to animate a flag waving. When I have a single flag in my scene, it works correctly. When I duplicate the flag, all of the copies become wildly ...
0
votes
1answer
973 views

Why my stencil mask doesn't work?

I've a very sipmle Unity scene. It has two objects in it, which is Sprites, and they both use sipmle black boxes as a textures. Here's two shaders, one should act as a mask, and second as a object, ...
0
votes
0answers
627 views

Adding an extra Pass to the Unity Standard Shader

I'm experimenting with adding some procedural textures to the unity standard shader. I'd like to add an extra pass (with vert and frag functions), but am unsure about where in the sequence this should ...
1
vote
0answers
1k views

Overlap transparent particles without blending? (Unity)

I'm trying to create a continuous output of light from an object (like the exhaust of a space ship), and I thought I'd use particles to achieve this. But I'm running into a problem with alpha blending....
1
vote
0answers
288 views

Shaderlab and Cg API reference [closed]

I am looking for definitive information on Shaderlab's API and the Cg language. The documentation I have found so far has been by way of example programs rather than a definition of APIs. Also, ...
4
votes
1answer
1k views

Selective Image Effects with Stencils

I am trying to create an image effect where only a part of the image has the effect applied to. One way I can think of to do this is to define the portion of the image using the stencil buffer. ...
6
votes
1answer
2k views

How are Stencil Buffer Operations Applied in ShaderLab

In Unity's Shader lab, I've read that the Stencil buffer is implemented with a mask, and an object reacting to the mask. The mask may be defined like the following: ...
0
votes
0answers
71 views

Unity equivalent of glDepthMask or alternative

I'm trying to achieve the following setup: 2 cubes. In the image attached they are the green and pink cube. They are both rendered culling their front faces, so that they are visible if a camera ...
1
vote
1answer
288 views

Problems with BlendOp Max

I'm trying to write a shader that doesn't blend additively etc etc. I'd like to take whichever of the source or destination colours is brighter and use that and ...
3
votes
2answers
467 views

How do I get a Light's Range value in Shader?

I'm trying to write a simple frag/vert shader that, depending on whether it is in the range of a light, will paint the appropriate colour from either the 'lit' texture or from the 'unlit' texture. ...
3
votes
1answer
771 views

How to apply a shader to only one side of an object in Unity3D

So I have this rather simple surface shader that essentially cuts a hole in the object based on another texture. ...
1
vote
1answer
4k views

Unity / How do I change the color of an object based on its depth?

The objective here is to change the color of the nearest object. (the nearer the object, the more "colorful" the object gets rendered; and the farther away, the more "grey" the object gets rendered), ...
0
votes
1answer
201 views

Unity Geometry Shader Compiles forever

I am writing a shader to achieve a laser show effect example. For now I am just focusing on the lines. One line ist represented as one triangle. When I save my shadercode, unity gets inactive and I ...
5
votes
1answer
10k views

Why can't I sample a texture in a vertex shader?

I'm old in Game Development but very new in shader writing. I just want a shader that transform from 1 texture to another. So I did start learning shader writing and wrote my desired shader. But ...