Forums - Shading issue on Adreno

2 posts / 0 new
Last post
Shading issue on Adreno
mlaban
Join Date: 28 Apr 13
Posts: 1
Posted: Fri, 2013-05-17 04:13

Hello,

We're hitting an issue with some piece of shader code in our app on Android. It only happens on Adreno GPU's, we thought maybe anyone here might have an idea...

We're rendering our objects with a shader that does a standard texture fetch and multiplies the diffuse lighting color to it. It works fine on most devices but on Adreno, the resulting color feels as if the diffuse multiplication is ignored and only the texture color is used.

Our fragment shader code looks like this:

float4 color = SAMPLE_TEXTURE(Texture, in.TexCoord) * in.Diffuse;
return color;

Our input values seem normal, outputing in.Diffuse returns the normal shading based on the current light position, ambient, normals etc...

We tested some variations to try to isolate the issue so for instance, taking the alpha out of the equation makes things work as expected (except for the broken rendering of transparent objects), ex:

color.rgb = SAMPLE_TEXTURE().rgb * in.Diffuse.rgb;

But as soon as alpha is mixed in there, it's as if we did color = SAMPLE_TEXTURE();

What's interesting is that when we run the app in the Adreno Profiler, the shading looks perfectly fine, the diffuse multiplication is properly done... 

Any hints or debugging ideas would be welcome :)


--
Matt

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 312
Posted: Sat, 2013-05-18 10:37

Matt - Could you describe the render target/frame buffer and alpha blend state?  Does the problem go away if you change your render target/frame buffer to not have an alpha component)?

 

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.