A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Introducing the new Universal Render Pipeline and High Definition Render Pipeline subforums!
Unity 2019.3 Beta is out now.
So, in this example everything with Cube material and located under 0.0 world space position is invisible, so I set ground plane to Y=0.0 to...
My approach is based on testing, if coordinates of cube in world space are located under certain vertical value (in my example: i.worldPos.y <...
Something like this ?
Shader "ZTest Shaders/Cube"
ObjectColor("Object Color", Color) = (1, 1, 1, 1)...
OK. Now version with "smooth" normals, sphere with center at point(50, 0, 0).
Shader "Draw Sphere"
I think this small piece of code can be useful, so I share. It draws sphere with center at point (0,0,0)
and has per-face lighting (normals...
Maybe this script will be helpful:
// A quaternion is a four-element vector that can be used to encode any rotation in a 3D coordinate system.
Procedural images (1024 x 1024) are generated in real-time from CUDA kernel mainImage.
Everything works fine in Editor (OpenGL 4.5), but with...
Update to the previous post:
This is a second version of CS script for situation, when we don't want to render output directly to screen, but to...
NVIDIA Mesh Shader with Unity OpenGL, simple example:
I made a plugin with simple example of NVIDIA Mesh Shader working with Unity OpenGL 4.5:
There is a code for generating volume texture (replace "hash" function by own code) :
void GenerateVolume (int size)
1. Passing data to shader by array:
Add CS script to quad/plane, material with shader, and audiosource....
You said about node-based editors. So I recommend to test Shader Forge, free version:
Minimal code and video:
Direct implementation, but still requires improvements:
metallic ("Metallic", Range (0.0,1.0)) =...
public class render : MonoBehaviour
void Blit(RenderTexture destination, Material mat)
RenderTexture.active = destination;
Something like this:
float4 ComputeScreenPos (float4 p)
float4 o = p * 0.5;
o.xy = float2(o.x, o.y*_ProjectionParams.x) + o.w;...
public class AppendBuffer : MonoBehaviour
public Material material;
public ComputeShader shader;...
1. Make sure that you use standard 3D template Unity project. This code currently not work properly with High-Definition RP or Lightweight RP...