Initial godot setup with billboarding experiment.
This commit is contained in:
commit
d0c9fe4fc0
13 changed files with 182 additions and 0 deletions
14
shaders/billboard.gdshader
Normal file
14
shaders/billboard.gdshader
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
shader_type spatial;
|
||||
|
||||
void vertex() {
|
||||
vec3 right = normalize(cross(vec3(0.0, 1.0, 0.0), to_camera));
|
||||
vec3 up = vec3(0.0, 1.0, 0.0);
|
||||
vec3 forward = normalize(cross(right, up));
|
||||
mat4 billboard_matrix = mat4(
|
||||
vec4(right, 0.0),
|
||||
vec4(up, 0.0),
|
||||
vec4(forward, 0.0),
|
||||
vec4(model_pos, 1.0)
|
||||
);
|
||||
MODELVIEW_MATRIX = VIEW_MATRIX * billboard_matrix;
|
||||
}
|
||||
1
shaders/billboard.gdshader.uid
Normal file
1
shaders/billboard.gdshader.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://du6owhb1rw1ic
|
||||
Loading…
Add table
Add a link
Reference in a new issue