diff --git a/res/shader/cnmr.gbuffer b/res/shader/cnmr.gbuffer index 493dc8ab..1caa5429 100644 --- a/res/shader/cnmr.gbuffer +++ b/res/shader/cnmr.gbuffer @@ -20,8 +20,11 @@ [gbuffer_to_attribute] - BaseColor =gb_color_metallic.rgb; - Metallic =gb_color_metallic.a; + vec4 gb_cm=texture(gb_color_metallic,FragmentPosition); + vec4 gb_cr=texture(gb_normal_roughness,FragmentPosition); - Normal =gb_normal_roughness.rgb; - Roughness =gb_normal_roughness.a; + BaseColor =gb_cm.rgb; + Metallic =gb_cm.a; + + Normal =gb_cr.rgb; + Roughness =gb_cr.a; diff --git a/res/shader/cnp.gbuffer b/res/shader/cnp.gbuffer new file mode 100644 index 00000000..87b6e612 --- /dev/null +++ b/res/shader/cnp.gbuffer @@ -0,0 +1,23 @@ +[attribute] + + vec3 BaseColor; + vec3 Normal; + vec3 Position; + +[gbuffer] + + vec3 gb_color; + vec3 gb_normal; + vec3 gb_position; + +[attribute_to_gbuffer] + + gb_color=BaseColor; + gb_normal=Normal; + gb_position=Position; + +[gbuffer_to_attribute] + + BaseColor =texture(gb_color, FragmentPosition); + Normal =texture(gb_normal, FragmentPosition); + Position =texture(gb_position, FragmentPosition);