flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > Depth independent transparency.

Author
Thread Post new topic Reply to topic
macgub



Joined: 11 Jan 2006
Posts: 350
Location: Poland
macgub 18 Jan 2019, 13:56
Depth independent transparency.
3d rotozoomer. Is this worth to see ?
http://macgub.co.pl/win/mariavincitbpt.zip
http://macgub.co.pl/win/mariavincitbpt_big.jpg


Last edited by macgub on 21 Jan 2022, 19:00; edited 2 times in total
Post 18 Jan 2019, 13:56
View user's profile Send private message Visit poster's website Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1150
Location: Russian Federation
comrade 20 Jan 2019, 05:41
Very beautiful!!
Post 20 Jan 2019, 05:41
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 20 Jan 2019, 09:15
I try download but google chrome do not open two links.
Post 20 Jan 2019, 09:15
View user's profile Send private message Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 350
Location: Poland
macgub 20 Jan 2019, 14:40
@comrade
I am glad you like it Exclamation
@Roman
Maybye try firefox or explorer ?
Anyway I attached both files to, perhaps, easier downloading.


Description: Screenshot.
Filesize: 94.33 KB
Viewed: 11968 Time(s)

mariavincitbpt_big.jpg


Description: Binaries and sources.
Download
Filename: mariavincitbpt.zip
Filesize: 133.45 KB
Downloaded: 871 Time(s)

Post 20 Jan 2019, 14:40
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 20 Jan 2019, 17:29
macgub wrote:
@comrade
I am glad you like it Exclamation
@Roman
Maybye try firefox or explorer ?
Anyway I attached both files to, perhaps, easier downloading.

No luck with Firefox as well. Maybe a DNS problem, but I’m too lazy to dive deeper.
Post 20 Jan 2019, 17:29
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 21 Jan 2019, 13:56
macgub thanks. Cool example. Good work.

I look your example and i see sse, but in file 3DMath.inc i see FPU.
FPU slow. FPU good if user CPU not supported SSE.
Code:
cross_product:
        fninit
        fld     dword [esi+vec_y]
        fmul    dword [edi+vec_z]
        fld     dword [esi+vec_z]
        fmul    dword [edi+vec_y]
        fsubp   ;st1 ,st
        fstp    dword [ebx+vec_x]

        fld     dword [esi+vec_z]
        fmul    dword [edi+vec_x]
        fld     dword [esi+vec_x]
        fmul    dword [edi+vec_z]
        fsubp   ;st1 ,st
        fstp    dword [ebx+vec_y]

        fld     dword [esi+vec_x]
        fmul    dword [edi+vec_y]
        fld     dword [esi+vec_y]
        fmul    dword [edi+vec_x]
        fsubp   ;st1 ,st
        fstp    dword [ebx+vec_z]
ret
    
Post 21 Jan 2019, 13:56
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 21 Jan 2019, 14:02
My SSE cross product.
Code:
macro xmcross chR1,chR2,chRt1,chRt2 {
   movaps  chRt1, chR1
   movaps  chRt2, chR2
   shufps  chR1, chRt1, 201                   
   shufps  chRt2, chR2, 210                   
   shufps  chRt1, chRt1, 210                   
   shufps  chR2, chR2, 201                   
   mulps   chR1, chRt2
   mulps   chRt1, chR2
   subps   chR1, chRt1           
              }    

In code: xmcross xmm1(=vec3 a),xmm2(=vec3 b),xmm3,xmm4
And we get cross(a,b);
Registers xmm3,xmm4 for internal calculation and then not needed.
Or all any others xmm registers.
Post 21 Jan 2019, 14:02
View user's profile Send private message Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 350
Location: Poland
macgub 21 Jan 2019, 17:40
Cross product in this app is not crucial. Its called only at the begining. 4 times, each for one wall of tetrahedron. Curucial are dot product and normalising vector routines:
Code:
;dot product
  ; in:   xmm1 - first vector, xmm2 - second vector
  ; out: xmm1 - broadcasted dot pr

  andps   xmm1,[mask]
  mulps   xmm1,xmm2
  haddps  xmm1,xmm1
  haddps  xmm1,xmm1
 
;normalising:
;  in:   xmm1 - vector, uses xmm2 for internal calculations
;  out: xmm1 - normalised vector

  andps     xmm1,[mask]
  movaps   xmm2,xmm1
  mulps     xmm1,xmm1
  haddps   xmm1,xmm1
  haddps   xmm1,xmm1
  rsqrtps    xmm1,xmm1
  mulps     xmm1,xmm2

; data for both cases

  mask: dd -1, dd -1,  dd,-1, dd 0
    
Post 21 Jan 2019, 17:40
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.