shaderlab

How do I discard pixels based on vertex color and turn that on or off in a MonoBehaviour?

白昼怎懂夜的黑 提交于 2019-12-24 19:05:32
问题 I've written a shader that uses a mesh's vertex colors and also has a function that clips all vertices that have an interpolated vertex color in the blue channel greater than 0.5 (discards all blue vertices). I'm trying to create a voice command that allows the user to call the function when they are ready. However, in Microsoft's Mixed Reality Toolkit Speech Input Handler, it only allows me to call functions from components (Mesh Renderer, Mesh Filter, Mesh Collider, etc.) of the GameObject

How can i convert uv coordinates to world space?

偶尔善良 提交于 2019-12-24 09:24:09
问题 I am trying to implement a shader. It will use with Unity LineRenderer. Shader will have noise that scrolling overtime raltive to texture coordinates. For example in parallel to x axis of uv space of texture. I have an implementation, but i dont'know how to get direction relative to texture uv (consider the texture rotation) in a vert function. I am only have a world space-relativew scrolling. Main problem - how to convert uv coordinates (for example (0, 0) or (1, 0)) to world space? Here is

How can i convert uv coordinates to world space?

青春壹個敷衍的年華 提交于 2019-12-24 09:23:36
问题 I am trying to implement a shader. It will use with Unity LineRenderer. Shader will have noise that scrolling overtime raltive to texture coordinates. For example in parallel to x axis of uv space of texture. I have an implementation, but i dont'know how to get direction relative to texture uv (consider the texture rotation) in a vert function. I am only have a world space-relativew scrolling. Main problem - how to convert uv coordinates (for example (0, 0) or (1, 0)) to world space? Here is

Implementing Fur with Shells technique in Unity

南笙酒味 提交于 2019-12-23 07:26:38
问题 I am trying to implement fur in Unity with the Shells technique. The Fins technique is purposely left out because I want this to run on low end mobiles (mostly Android devices) and that requires OpenGL ES 3.0 and above while Shells technique only requires OpenGL ES 2.0 . There is an example on the Shell technique based on XNA and I made an attempt to port that into Unity but it failed to work. Here is the article with the XNA project. The XNA shader: float4x4 World; float4x4 View; float4x4

How to create a shader that can display a texture made out of many small images in Unity

萝らか妹 提交于 2019-12-11 08:09:42
问题 So what I'm trying to do is load satellite images from an SQL table and wrap them around a sphere to create a globe. I know I've got loading the images covered, I'm just not sure how to make my shader display the images in the correct orientation. I've gone to the Unity Forums as well as checked out this code from the Unity Docs. Using the linked shader code and the help I received on the forums, here's the code I've ended up with: Properties { _MainTexArray("Tex", 2DArray) = "" {}