-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IMPROVEMENT: Better star shader, lesser star polycount
- Loading branch information
Showing
55 changed files
with
731 additions
and
137 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,49 @@ | ||
shader_type spatial; | ||
render_mode depth_draw_opaque, cull_front, unshaded; | ||
|
||
uniform vec4 halo_color : hint_color; | ||
uniform vec4 corona_color : hint_color; | ||
uniform vec4 core_color : hint_color; | ||
uniform float rim_strength = 0.05; | ||
uniform float rim_power = 9.0; | ||
uniform float core_strength = 0.05; | ||
uniform float core_power = 9.0; | ||
uniform float core_amount = 0.05; | ||
|
||
uniform float halo_strength = 0.2; | ||
uniform float halo_power = 1.0; | ||
uniform float halo_amount = 1.0; | ||
|
||
// For logarithmic depth buffer. | ||
const float c = 0.001; | ||
varying vec4 gl_Position; | ||
uniform float corona_strength = 10.0; | ||
uniform float corona_power = 10.0; | ||
uniform float corona_amount = 1.0; | ||
|
||
void vertex() | ||
{ | ||
// For logarithmic depth buffer. | ||
gl_Position = MODELVIEW_MATRIX*vec4(VERTEX, 1.0); | ||
uniform float core_strength = 50.0; | ||
uniform float core_power = 50.0; | ||
uniform float core_amount = 50.0; | ||
|
||
uniform sampler2D displacement_texture; | ||
uniform float displacement_scale = 0.02; | ||
uniform float displacement_velocity = 0.01; | ||
|
||
|
||
void vertex() { | ||
vec2 tex_position_x = VERTEX.yz / 1.0 - TIME*displacement_velocity; | ||
vec2 tex_position_y = VERTEX.xz / 1.0 + TIME*displacement_velocity; | ||
vec2 tex_position_z = VERTEX.xy / 1.0 - TIME*displacement_velocity; | ||
|
||
float displacement_x = 2.0*texture(displacement_texture, tex_position_x).r-1.0; | ||
float displacement_y = 2.0*texture(displacement_texture, tex_position_y).r-1.0; | ||
float displacement_z = 2.0*texture(displacement_texture, tex_position_z).r-1.0; | ||
|
||
VERTEX.z += displacement_z * displacement_scale; | ||
VERTEX.x += displacement_x * displacement_scale; | ||
VERTEX.y += displacement_y * displacement_scale; | ||
} | ||
|
||
void fragment() | ||
{ | ||
// Logarithmic depth buffer. | ||
// DEPTH = log2(max(1e-6, 1.0 -gl_Position.z)) * c; | ||
|
||
float rim = clamp(pow( dot( NORMAL, VIEW ), rim_power)*rim_strength, 0.0, 1.0); | ||
float halo = clamp(pow( dot( NORMAL, VIEW ), halo_power)*halo_strength, 0.0, 1.0); | ||
float corona = clamp(pow( dot( NORMAL, VIEW ), corona_power)*corona_strength, 0.0, 1.0); | ||
float core = clamp(pow( dot( NORMAL, VIEW ), core_power)*core_strength, 0.0, 1.0); | ||
ALBEDO = corona_color.rgb + core*core_amount*core_color.rgb; | ||
ALPHA = rim; | ||
ALBEDO = | ||
halo*halo_amount*halo_color.rgb | ||
+ corona*corona_amount*corona_color.rgb | ||
+ core*core_amount*core_color.rgb; | ||
ALPHA = halo; | ||
} |
File renamed without changes
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
File renamed without changes
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/deccel.png-b6d5396ca46f31de70e8cda45673d78c.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://Assets/UI_images/png/buttons/deccel.png" | ||
dest_files=[ "res://.import/deccel.png-b6d5396ca46f31de70e8cda45673d78c.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=true | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
process/normal_map_invert_y=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=true | ||
svg/scale=1.0 |
File renamed without changes
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
File renamed without changes
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/options.png-789ca28e3b2456756f3f62f3b8f9d7e1.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://Assets/UI_images/png/buttons/options.png" | ||
dest_files=[ "res://.import/options.png-789ca28e3b2456756f3f62f3b8f9d7e1.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=true | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
process/normal_map_invert_y=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=true | ||
svg/scale=1.0 |
File renamed without changes
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
File renamed without changes
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/turret.png-f112c7511134b36ec611a76cf878fe2e.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://Assets/UI_images/png/buttons/turret.png" | ||
dest_files=[ "res://.import/turret.png-f112c7511134b36ec611a76cf878fe2e.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=true | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
process/normal_map_invert_y=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=true | ||
svg/scale=1.0 |
File renamed without changes
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.