32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
![]() |
[gd_resource type="Shader" format=3 uid="uid://bmgpmbthlfon3"]
|
||
|
|
||
|
[resource]
|
||
|
code = "// NOTE: Shader automatically converted from Godot Engine 4.3.stable.mono's StandardMaterial3D.
|
||
|
|
||
|
shader_type spatial;
|
||
|
render_mode blend_mix, world_vertex_coords, depth_draw_opaque, cull_front, diffuse_burley, specular_schlick_ggx, unshaded;
|
||
|
|
||
|
#include \"res://addons/rokojori_action_library/Runtime/Shading/Library/Math.gdshaderinc\"
|
||
|
#include \"res://addons/rokojori_action_library/Runtime/Shading/Library/Transform.gdshaderinc\"
|
||
|
#include \"res://addons/rokojori_action_library/Runtime/Shading/Library/Noise.gdshaderinc\"
|
||
|
|
||
|
uniform vec4 albedo : source_color;
|
||
|
uniform float sizeClose : hint_range(0,100) = 1;
|
||
|
uniform float sizeFar : hint_range(0,100) =1;
|
||
|
uniform float closeDistance = 5;
|
||
|
uniform float farDistance = 100;
|
||
|
|
||
|
|
||
|
void vertex()
|
||
|
{
|
||
|
float cameraDistance = distance( VERTEX, CAMERA_POSITION_WORLD );
|
||
|
float size = mapClamped( cameraDistance, closeDistance, farDistance, sizeClose, sizeFar );
|
||
|
VERTEX += NORMAL * size/500.0 * cameraDistance;
|
||
|
}
|
||
|
|
||
|
void fragment()
|
||
|
{
|
||
|
ALBEDO = albedo.rgb;
|
||
|
}
|
||
|
"
|