This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credit: https://www.patreon.com/posts/grass-geometry-1-40090373 | |
using UnityEngine; | |
public class ShaderInteractor : MonoBehaviour | |
{ | |
private void Update() | |
{ | |
// Set player position | |
Shader.SetGlobalVector("_MovingPosition", transform.position); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by @Forkercat on 03/04/2021. | |
// | |
// A URP compute shader renderer to upload data (created by grass painter tool) | |
// to compute shader. Check out shader files for mode definitions and comments. | |
// | |
// [Added Features] | |
// 1. Override Material Properties (color, ambient strength) | |
// 2. Cast Shadow Checkbox (since we are not using MeshRenderer anymore, we can do it here) | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by @Forkercat on 03/04/2021. | |
// | |
// A URP grass shader using compute shader rather than geometry shader. | |
// This file contains kernel function which works like a geometry function. | |
// It defines the buffers needed to pass data from renderer C# script to here | |
// and from here to our vertex and fragment functions. | |
// | |
// Note that data flows differently in different cases. | |
// [Compute Shader] Data Flow : Mesh -> Compute Shader -> Vertex Shader -> Fragment Shader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by @Forkercat on 03/04/2021. | |
// | |
// A URP grass shader using compute shader rather than geometry shader. | |
// This file contains vertex and fragment functions. It also defines the | |
// structures which should be the same with the ones used in GrassCompute.compute. | |
// | |
// References & Credits: | |
// 1. GrassBlades.hlsl (https://gist.github.com/NedMakesGames/3e67fabe49e2e3363a657ef8a6a09838) | |
// 2. GrassGeometry.shader (https://pastebin.com/VQHj0Uuc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by @Forkercat on 03/04/2021. | |
// | |
// A URP grass shader using compute shader rather than geometry shader. | |
// It includes "GrassCompute.hlsl" which contains vertex and fragment functions. | |
// | |
// Note that this shader works with the grass painter tool created by MinionsArt. | |
// Checkout the website for the tool scripts. I also made an updated version that | |
// introduces shortcuts just for convenience. | |
// https://www.patreon.com/posts/geometry-grass-46836032 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compute Shader Version of The Grass Painter by MinionsArt | |
// 1. Some renames | |
// 2. Added several shortcuts | |
// 3. Added mesh name | |
// 4. Mesh component is public | |
// 5. Remove MeshRenderer component requirement | |
// Source: https://pastebin.com/xwhSJkFV | |
// Tutorial: https://www.patreon.com/posts/geometry-grass-46836032 | |
using System.Collections.Generic; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Updated Version of The Grass Paint Editor by MinionsArt | |
// 1. Some renames | |
// 2. Added shortcut hint | |
// 3. Updated UI (progress bar, etc) | |
// Source: https://pastebin.com/Y7dCRAd3 | |
// Tutorial: https://www.patreon.com/posts/geometry-grass-46836032 | |
using UnityEditor; | |
using UnityEditorInternal; | |
using UnityEngine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Updated Version of The Grass Painter by MinionsArt | |
// 1. Some renames | |
// 2. Added several shortcuts | |
// 3. Added mesh name | |
// Source: https://pastebin.com/xwhSJkFV | |
// Tutorial: https://www.patreon.com/posts/geometry-grass-46836032 | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.Map; | |
/** | |
* @author Junhao Wang | |
* @date 01/05/2020 | |
*/ | |
// WayBid.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
// 记得导入类 | |
/** | |
* @author Junhao Wang | |
* @date 01/05/2020 | |
*/ | |
// 注意不要用下划线命名! |
NewerOlder