Hello!
I have a question about render. I am trying to render nanosuit model only with its diffuse texture.
If fragment shader is
color = vec4(texture(u_DiffuseTexture, Input.texCoord).rgb, 1.0);
if my fragment shader is
color = texture(u_DiffuseTexture, Input.texCoord);
Render result is
Top picture is rendered by first fragment shader.
I only enable depth test.
I want to konw why this happed, why some area is black.
Given that the two produce different results, it’s clear that either a) GL_BLEND
is enabled or b) you’re writing to a framebuffer with an alpha channel and additional operations are performed upon the rendered image prior to display.
If you render directly to the default (physical) framebuffer without blending, the alpha component has no effect. Alpha is just a parameter whose effect is determined elsewhere.
Yes, you’re right. I am rendering to new frambuffer with alpha channel,the render result is diplayed by imgui::image function, but I still want to konw why some area is black?
I try to render this to default frambuffer with
color = texture(u_DiffuseTexture, Input.texCoord);
And result is right.
Thank you!