add gbuffer files

This commit is contained in:
hyzboy 2020-01-17 17:06:23 +08:00
parent 914e9189bc
commit 1c48afe266
2 changed files with 42 additions and 0 deletions

27
res/shader/cnmr.gbuffer Normal file
View File

@ -0,0 +1,27 @@
[attribute]
vec3 BaseColor;
vec3 Normal;
float Metallic;
float Roughness;
[output]
vec4 gb_color_metallic;
vec4 gb_normal_roughness;
[attribute_to_gbuffer]
gb_color_metallic.rgb =BaseColor;
gb_color_metallic.a =Metallic;
gb_normal_roughness.rgb =Normal;
gb_normal_roughness.a =Roughness;
[gbuffer_to_attribute]
BaseColor =gb_color_metallic.rgb;
Metallic =gb_color_metallic.a;
Normal =gb_normal_roughness.rgb;
Roughness =gb_normal_roughness.a;

15
res/shader/color.gbuffer Normal file
View File

@ -0,0 +1,15 @@
[attribute]
vec4 BaseColor;
[output]
vec4 gb_color;
[attribute_to_gbuffer]
gb_color=BaseColor;
[gbuffer_to_attribute]
BaseColor=texture(gb_color,vs_out_position);