Add billboard effect to flag shine
This commit is contained in:
parent
06bf7bf2ae
commit
b67cbe9ba2
|
@ -11,11 +11,12 @@ extents = Vector3( 0.584547, 2.22627, 0.659734 )
|
||||||
|
|
||||||
code = "shader_type spatial;
|
code = "shader_type spatial;
|
||||||
|
|
||||||
// TODO: Billboard effect
|
// BILLBOARD_FIXED_Y
|
||||||
//void vertex() {
|
// from: https://github.com/godotengine/godot/blob/master/scene/resources/material.cpp#L552
|
||||||
// UV=UV*uv1_scale.xy+uv1_offset.xy;
|
void vertex() {
|
||||||
// MODELVIEW_MATRIX = INV_CAMERA_MATRIX * mat4(CAMERA_MATRIX[0],WORLD_MATRIX[1],vec4(normalize(cross(CAMERA_MATRIX[0].xyz,WORLD_MATRIX[1].xyz)),0.0),WORLD_MATRIX[3]);
|
MODELVIEW_MATRIX = INV_CAMERA_MATRIX * mat4(CAMERA_MATRIX[0],WORLD_MATRIX[1],vec4(normalize(cross(CAMERA_MATRIX[0].xyz,WORLD_MATRIX[1].xyz)),0.0),WORLD_MATRIX[3]);
|
||||||
//}
|
MODELVIEW_MATRIX = MODELVIEW_MATRIX * mat4(vec4(length(WORLD_MATRIX[0].xyz),0,0,0),vec4(0,1,0,0),vec4(0,0,length(WORLD_MATRIX[2].xyz),0),vec4(0,0,0,1));
|
||||||
|
}
|
||||||
|
|
||||||
void fragment() {
|
void fragment() {
|
||||||
float max_dist = 0.5; // maximum orthogonal distance from center in a [0,1] rectangle
|
float max_dist = 0.5; // maximum orthogonal distance from center in a [0,1] rectangle
|
||||||
|
|
Loading…
Reference in a new issue