Skip to main content
12 votes
Accepted

How to make a 2D neon-like trail effect in Unity

To achieve this effect my friend has created a custom sprite, we played around with all sorts of sprites and you can customize this part to your liking. The shader I've written for this effect, takes ...
John Hamilton's user avatar
4 votes
Accepted

How to write shaders that can be compiled for DirectX, OpenGL, and Vulkan

This problem is often solved through the use of a transpiler, a program that can translate a shader written in one language into another. HLSL2GLSL is one such example that was used in Unity up until ...
DMGregory's user avatar
  • 136k
4 votes
Accepted

Simple square vertex lifting shader

This is actually an illusion. The vertices are not lifted: There aren't enough vertices in the model to create the pinata effect. Here are the tricks: The normal map has squares in it to create the ...
Stephane Hockenhull's user avatar
4 votes
Accepted

Depth Intersection Shader

This issue exists with the original shader as well, but is less apparent with the sphere mesh. Notice how it looks alright when the model's vertices are close to the intersecting object. But as they ...
jhoffman0x's user avatar
3 votes

Identify shading language in Trove

I can't comment since I don't have enough rep yet. As UnholySheep said in the comments to your question, looking at the .common files you can find out that this is indeed a custom shader language. ...
RelicBloodvayne's user avatar
3 votes

What does declaring a const float within a function do? (CGFX)

A const value is never changed after it is initialized. By declaring a const the compiler can do certain optimizations, like calculating the const value at compile time instead of at runtime and ...
Fuzzy Logic's user avatar
  • 1,758
2 votes

Modifying Alpha in Unity Standard Shader

You need to make 3 small changes to your shader: You need to have the Queue properly set to Transparent or it won't render at all: ...
Draco18s no longer trusts SE's user avatar
2 votes

How to prevent intepolated texture in fragment shader (Unity CG)

If you want to do this without a script, simply in the Project Window: Select your image in the Assets folder The Import Settings will now be visible in the Inspector Window In Import Settings, Find "...
nathanfranke's user avatar
1 vote

How to support Texture Tiling + Offset for custom shader

I felt silly posting this question because I knew the answer would be simple. Here's what was missing First Pass: float4 _MainTex_ST; v2f vert: ...
Jacksonkr's user avatar
  • 249
1 vote
Accepted

What does vertex:disp and tessellate:tessEdge mean? [Shader] [Unity]

Vertex shader It is possible to use a “vertex modifier” function that will modify the incoming vertex data in the vertex Shader. This can be used for things like procedural animation and extrusion ...
Seyed Morteza Kamali's user avatar
1 vote
Accepted

How can I write a dots effect shader when the character is behind an object?

In Amplify forum I found this shader: We've performed some changes to the XRay sample in order to allow for the effect that you've requested. Here's a package that contains updated shaders, ...
Seyed Morteza Kamali's user avatar
1 vote

UI Billboard Shader - Wrong rotation pivot - Unity

For optimization Unity usually batches meshes under certain circumstances. This messes up your reference system. To prevent Unity from batching the meshes add this tag to any shader that breaks with ...
Emilio Martinez's user avatar
1 vote

Determining which point is further along a direction vector

Considering you know a point of the plane (Camera position) and the normal, I would just do the dot product for each corner. For example if O is the camera ...
realUser404's user avatar
  • 1,057
1 vote

CG: 4+ color gradient

if any one still need it. ...
Meuk Light's user avatar
1 vote
Accepted

CG: 4+ color gradient

The following code creates a 4 color gradient texture and applies it to the shader. The code needs to be attached to the object that has the shader on it. ...
Dennis's user avatar
  • 411
1 vote
Accepted

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

Have opted to use my 'workaround' shader as posted in the question. _Pullup can be tuned appropriately in the material to match the range of the light as closely as ...
LeftRight92's user avatar
1 vote

What is an animated surface mesh?

I have got a good answer to this question from https://www.zhihu.com/question/50173048?from=profile_question_card. The paper says: Problem statement. We aim at approximating a mesh animation ...
Xinyue Lei's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible