Forums - Adreno 320 3D Graphics and Shader Optimizations?

9 posts / 0 new
Last post
Adreno 320 3D Graphics and Shader Optimizations?
alen.tepes
Join Date: 11 May 13
Posts: 4
Posted: Sat, 2013-05-11 06:08

Hello,

i am developing 3D applications and found wierd annoying issue with Adreno 320(nexus 4) while adreno 200's works OK and tested on PowerVR SGX

works fine. 

Whats the  problem is discarding pixels.

when the dot product of the two direction vectors were negative at angles between (camera vs light) 90 and 275 degrees, the numbers seem to just get truncated which resulted in the corresponding pixel to just get discarded.

 

In my shader i have loop, first i thought the loop is problem so then i just unrolled loop outside of shader. This didnt fixed the problem then i found that is problem onto the dot product.

 

In info regarding this would be appriciated.

  • Up0
  • Down0
alen.tepes
Join Date: 11 May 13
Posts: 4
Posted: Sun, 2013-05-12 12:16

Well i fixed it with normalizing vectors,

 

so my question is why is Adreno 320 is limited while 200's working ok with normal vectors without normalizing it?

  • Up0
  • Down0
alen.tepes
Join Date: 11 May 13
Posts: 4
Posted: Sun, 2013-05-12 12:16

Well i fixed it with normalizing vectors,

 

so my question is why is Adreno 320 is limited while 200's working ok with normal vectors without normalizing it?

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Mon, 2013-05-13 07:59

Hi Alen..

At first glance, it could be related to the precision being used in your shaders.  Could you provide source for the shaders so we can take a closer look?

 

 

 

  • Up0
  • Down0
alen.tepes
Join Date: 11 May 13
Posts: 4
Posted: Mon, 2013-05-13 10:24

Well i used precision highp float and med for int.

The case is about Light Position, if its used for direction calculation  to object and reflection to camera. so istead of light direction let say for an example vec3(0.0002 , 12.13 , 30.8);

the pixels just discard, i see transparent instead of mate or blue.

If i use normalize(Math.sqrt(x * x + y * y + z * z);) in java before is pushed to shader so the vectors dont go above 1.0 its OK and working.

Why is this i dont know, while in other GPU's working fine.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Mon, 2013-05-13 14:00

There could numerous reasons for the differences in results with other gpus including the precision. Would it be possible to see your shader code?, It's hard to diagonse with just the comments and observations above.

 

  • Up0
  • Down0
Sebastien
Join Date: 21 Dec 21
Posts: 20
Posted: Tue, 2023-08-01 23:04
Re: Adreno 320 3D Graphics and Shader Optimizations?
  • Up0
  • Down0
mado.jessu
Join Date: 6 Oct 22
Posts: 27
Posted: Tue, 2023-08-01 23:10
Re: Adreno 320 3D Graphics and Shader Optimizations?
  • Up0
  • Down0
Sjessus60
Join Date: 3 Oct 22
Posts: 28
Posted: Tue, 2023-08-01 23:15
Re: Adreno 320 3D Graphics and Shader Optimizations?
  • 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.