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 ...
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 ...
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 ...
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 ...
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. ...
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 ...
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:
...
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 "...
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: ...
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 ...
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, ...
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 ...
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 ...
1
vote
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.
...
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 ...
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
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cg × 64shaders × 52
unity × 39
glsl × 13
hlsl × 12
fragment-shader × 12
opengl × 10
shaderlab × 7
graphics × 2
graphic-effects × 2
geometry-shader × 2
c# × 1
c++ × 1
xna × 1
android × 1
mathematics × 1
textures × 1
animation × 1
architecture × 1
algorithm × 1
sprites × 1
directx × 1
tilemap × 1
gui × 1
graphics-programming × 1