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
#Based on Procedural Toolkit by Syomus (https://github.com/Syomus/ProceduralToolkit) | |
@tool | |
extends PrimitiveMesh | |
class_name DiamondMesh | |
enum CutType { | |
Octahedral, | |
Table, | |
OldMine, | |
OldEuropean, |
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
shader_type spatial; | |
render_mode blend_add, cull_disabled; | |
/** amount of influence camera direction has on noise */ | |
uniform float direction_scale = 4.0; | |
/** amount of influence vertex position has on noise */ | |
uniform float vertex_scale = 1.5; | |
/** power applied to each channel | |
Higher values will make edges smoother, low values will make edges sharper |
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] | |
#version 450 | |
// Invocations in the (x, y, z) dimension | |
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in; | |
layout(rgba16f, set = 0, binding = 0) uniform image2D small_image; | |
layout(rgba16f, set = 0, binding = 1) uniform image2D color_image; |
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
shader_type spatial; | |
render_mode unshaded, depth_test_disabled; | |
// will need to assign this in code because I can't get Godot to save it as a property of material | |
uniform uint tilemap[1024]; // up to 128 8-byte 8x8 tiles | |
uniform int screenWidth = 168; | |
uniform int screenHeight = 64; | |
varying vec4 calcscreen; //calculated screen size and |
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
shader_type sky; | |
uniform sampler2D skyTexture:source_color; | |
void sky() { | |
COLOR = textureLod(skyTexture, SKY_COORDS, 0.0).rgb; | |
} |
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
@tool | |
extends EditorScript | |
# converts an equirectangular panoramic texture to a skyamid format | |
var source_panorama:String = "res://skybox_example_pano_left.png" | |
var target_skyamid:String = "res://skyamid.png" | |
func _run() -> void: | |
# load source |
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
@tool | |
extends EditorScript | |
class_name GenerateCubemapEditorScript | |
# collection of helper scripts for generating cubemaps | |
# file you wish to output the generated cubemap to | |
var cubemap_filename:String = "new_cubemap.tres" |
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] | |
#version 450 | |
// Invocations in the (x, y, z) dimension | |
layout(local_size_x = 8, local_size_y = 1, local_size_z = 1) in; | |
layout(rgba16f, set = 0, binding = 0) uniform restrict image2D distances; //distances to walls along each raycast, as well as data for wall texture | |
layout(rgba16f, set = 0, binding = 1) uniform restrict image2D map; //map to raycast on |
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
shader_type spatial; | |
render_mode unshaded, blend_mul, depth_draw_never, depth_test_disabled; | |
// creates a silhouette that appears when the mesh is behind something else | |
// you can combine this with another material by assigning this as the Next Pass material | |
// this might need adjustment to work with 4.3 and later, because of the reversed depth | |
uniform vec3 shadow_colour:source_color = vec3(0.7,0.7,0.9); | |
uniform sampler2D depth_texture:hint_depth_texture; |
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
extends Node3D | |
# Sets position of hole that makes character visible through walls | |
func _process(delta): | |
RenderingServer.global_shader_parameter_set("character_position", global_position) | |
NewerOlder