Overview Features Coding ApolloOS Performance Forum Downloads Products Contact Goto
Apollo-Computer

Welcome to the Apollo Forum

This forum is for people interested in the APOLLO CPU.
Please read the forum usage manual.
Please visit our Apollo-Discord Server for support.



All TopicsNewsPerformanceGamesDemosApolloVampireAROSWorkbenchATARIReleases
Information about the Apollo CPU and FPU.

Can I Have Some New AMMX Mnemonics?page  1 2 

Mr Niding

Posts 459
03 Aug 2017 14:00


I apologize for polluting this thread with non code posting, since this is far above my understanding but;

"i want to optimize the tinygl library"

Im just curious as to what programs/games will be able to utilize this optimization? I guess Quake which we all love to use as a performance scale. Anyhow, I hope you manage to tweak the library, and thanks for your efforts Andreas! :)


Gunnar von Boehn
(Apollo Team Member)
Posts 6254
03 Aug 2017 14:33


Andreas Timmermann wrote:

the problem in the code is the wrapping.
you need a compare and a branch every time.

 
Are you sure?
Can you give me an example to clarify this?


Andreas Timmermann

Posts 11
03 Aug 2017 16:04


not at this moment. first, the zbuffer must be finished ;-)


Gregthe Canuck

Posts 274
04 Aug 2017 04:24


Go Andreas!!  :)


Michael Borrmann

Posts 140
04 Aug 2017 07:58


Yeah, go for it!!! :)


Thellier Alain

Posts 143
04 Aug 2017 09:35


"i want to optimize the tinygl library"
NICE

>and then you have it. d4.w = YYXX
Nice too but then you are limited to 256x256 textures max
Also textures can repeat so UV values may have a value like (say) 4.0 meaning "repeat texture 4 times among the triangle"
So even a 256 pix texture can reach a 1024 value (here 256*4)

Certainly the most flexible solution would be to have
d0.l=XXXXxxxx
d1.l=YYYYyyyy
but then certainly  will need a new 68080 operator to get the pixel from (d0,d1,texture) at decent speed

About the Zbuffer: for the moment you only do the test/update zbuffer stuff but how do you keep a track of the test ?
I mean

for(segment size)
if(zbuffertest[n])
    drawpixel();

Alain Thellier



Andreas Timmermann

Posts 11
04 Aug 2017 15:32


thellier alain wrote:

    for(segment size)
    if(zbuffertest[n])
        drawpixel();
   

   
    you only draw at the end of the frame. so the algorithm goes like this:
   
  for every triangle
  {
      for every block in the triangle
      {
          calculate new_zmin and new_zmax
          if new_zmin > zbuffer_block_zmax
          {
                skip block
          }
          else
          if new_zmax < zbuffer_block_zmin
          {
                replace zbuffer_block with new_block (no zbuffer calculation needed, because all new values are smaller then all zbuffer_block_z)
                save only new_zmin/new_zmax
          }
          else
          {
                  insert new_block in zbuffer_blocklist and change zbuffer_block_zmin/max
          }
      }
  }
  update all zbuffer_block and render texture
   
    so, you don't need to update zbuffer_block's every time. and if there is no overlapping, you don't need to update zbuffer_block too :-)


Grzegorz Wójcik (pisklak
(Apollo Team Member)
Posts 87
04 Aug 2017 15:37


Whatever you do - good luck man !
Have some AMMX fun ! :)


Gunnar von Boehn
(Apollo Team Member)
Posts 6254
04 Aug 2017 15:43


thellier alain wrote:

  Certainly the most flexible solution would be to have
  d0.l=XXXXxxxx
  d1.l=YYYYyyyy
  but then certainly  will need a new 68080 operator to get the pixel from (d0,d1,texture) at decent speed

APOLLO has in instruction which can help here a lot PERM
PERM can pick any Bytes from 2 registers
PERM is single cycle and can be executed Super-scalar in both pipes = 2 instructions per cycle.

PERM should be useful for byte juggling you want to do in this Fix.Point math


posts 29page  1 2