Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GBufferPost using wrong GBuffer layout #91

Open
SergioAlapontARM opened this issue Mar 10, 2022 · 0 comments
Open

GBufferPost using wrong GBuffer layout #91

SergioAlapontARM opened this issue Mar 10, 2022 · 0 comments

Comments

@SergioAlapontARM
Copy link
Contributor

SergioAlapontARM commented Mar 10, 2022

The way GBufferPost.ankiprog stores data in GBuffer attachments now is out of date.

	const ANKI_RP Vec3 spec = texture(u_specularRoughnessDecalTex, u_trilinearRepeatSampler, specUv).rgb;

	// Update diffuse
	ANKI_RP F32 f = decalDiff.a * decal.m_blendFactors[0];
	diffuse.rgb = diffuse.rgb * (1.0 - f) + decalDiff.rgb * f;
	diffuse.a *= (1.0 - f);

	// Update specular
	f = decalDiff.a * decal.m_blendFactors[1];
	roughnessMetallicF0.rgb = roughnessMetallicF0.rgb * (1.0 - f) + spec.rgb * f;
	roughnessMetallicF0.a *= (1.0 - f);
}

out_diffuse = diffuse;
out_roughnessMetallicF0 = roughnessMetallicF0;

Gbuffer layout is packed as follows for the RT0 and RT1:

  • RT0: Diffuse (RGB) A (Metallic & Subsurface)
  • RT1: Roughness (R), Fresnel (G), Emissive (BA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant