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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [shaderlab]

The tag has no usage guidance.

0
votes
0answers
7 views

Unity - How to use instanced properties of a shader?

I just want a simple effect such that on every object using the same material, the texture has different uv offsets, while keeping them batched in one draw call. By my understanding I first tried to ...
1
vote
1answer
35 views

how are semantics used when declaring a struct?

I don't understand how semantics are used in shaders. While reading Unity's shader tutorials, I come across this ...
1
vote
1answer
111 views

Morphing a 3D model into a sphere or cube using a vertex shader

I want to morph between 3d models.I found a simple OpenGL code to morphing In Graphics Shaders: Theory and Practice(page 456) but I couldn't Implement it correctly in unity. ...
0
votes
0answers
93 views

Unity Mobile Bumped Specular Shader with reflections // Error at texCUBE

I extended the builtin Mobile/Bumped Specular shader to display reflections: ...
0
votes
1answer
258 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
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
0answers
70 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
81 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
510 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
59 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 ...
71
votes
1answer
9k 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
1k 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 ...
8
votes
1answer
2k 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: ...
11
votes
3answers
2k 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
396 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
105 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
270 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
65 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
607 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
86 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
83 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
522 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 ...
8
votes
1answer
271 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
1k 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, ...
1
vote
0answers
743 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
328 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
3k 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
82 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
333 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
529 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
881 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
208 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
11k 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 ...