This file contains hidden or 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
| shader_type spatial; | |
| render_mode unshaded; | |
| //renders vertical gradient that centres on node's position | |
| uniform vec4 _TopColour:source_color = vec4(1.0,1.0,1.0,1.0); | |
| uniform vec4 _BottomColour:source_color = vec4(0.0,0.0,0.0,1.0); | |
| uniform float _Height = 1.0; | |
| uniform float _exp = 1.0; | |
| void fragment() { |
This file contains hidden or 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
| shader_type sky; | |
| uniform sampler2D moon_texture:source_color, repeat_disable; | |
| // updirection of moon texture will try to align with this | |
| uniform vec3 north = vec3(0, 0, -1); | |
| void sky() { | |
| vec3 light_dir = normalize(-LIGHT0_DIRECTION); | |
| vec3 side_dir = normalize(cross(light_dir, north)); |
This file contains hidden or 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
| shader_type canvas_item; | |
| // displays a texture but distorts it based on the size of the top and bottom | |
| uniform sampler2D main_texture:source_color, repeat_disable; | |
| // scale the bottom of the image | |
| uniform float scale_x_bottom = 1.0; | |
| // scale the top of the image | |
| uniform float scale_x_top = 1.0; |
This file contains hidden or 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
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| [ExecuteInEditMode] | |
| public class OnePointPerspective : MonoBehaviour { | |
| [SerializeField] | |
| private Camera camcam; |
This file contains hidden or 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
| #Based on Procedural Toolkit by Syomus (https://github.com/Syomus/ProceduralToolkit) | |
| @tool | |
| extends PrimitiveMesh | |
| class_name DiamondMesh | |
| enum CutType { | |
| Point, | |
| Table, | |
| OldMine, | |
| OldEuropean, |
This file contains hidden or 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
| shader_type canvas_item; | |
| // expects this as 4x2 | |
| // black, red, blue, magenta | |
| // green, yellow, cyan, white | |
| // set alpha to 0 for sections you don't want replaced | |
| // usually black pixel is alpha 0 because most colours are below threshold | |
| uniform sampler2D colours:source_color; | |
| // threshold for what counts as full saturation |
This file contains hidden or 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
| @tool | |
| extends PortableCompressedTexture2D | |
| class_name CanvasWrapper | |
| @export var source_texture:Texture2D: | |
| get: | |
| return source_texture | |
| set(new_value): | |
| if source_texture != new_value: |
This file contains hidden or 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
| shader_type canvas_item; | |
| // pixelated shader for use with Line2D | |
| // will still have incorrect behaviour at tips and corners where there can be diagonal cut-offs that don't align with pixel_size | |
| uniform int pixel_size = 4; | |
| void fragment() { | |
| vec2 rounded_pixel = floor(FRAGCOORD.xy / float(pixel_size)) * float(pixel_size); // | |
| vec2 pixel_diff = FRAGCOORD.xy - rounded_pixel; |
This file contains hidden or 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
| shader_type spatial; | |
| // if you have a mesh with big flat surfaces this might work better than a triplanar shader | |
| // applied to a curved surfact this will look distorted | |
| uniform sampler2D main_texture:source_color, repeat_enable; | |
| uniform float scale = 1.0; | |
| varying vec3 world_pos; | |
| varying vec3 world_tangent; |
This file contains hidden or 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
| shader_type spatial; | |
| render_mode cull_disabled; | |
| uniform float threshold = 0.0; | |
| uniform vec3 direction = vec3(0.0, 1.0, 0.0); | |
| // normal of dividing plane in model space | |
| varying vec3 local_plane_normal; |
NewerOlder