flat assembler
Message board for the users of flat assembler.

flat assembler > Examples and Tutorials > Depth independent transparency.

Author
Thread Post new topic Reply to topic
macgub



Joined: 11 Jan 2006
Posts: 232
Location: Poland
Depth independent transparency.
3d rotozoomer. Is this worth to see ?
http://macgub.vxm.pl/win/mariavincitbpt.zip
http://macgub.vxm.pl/win/mariavincitbpt_big.jpg
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: 1135
Location: Russian Federation
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: 495
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: 232
Location: Poland
@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: 1493 Time(s)

mariavincitbpt_big.jpg


Description: Binaries and sources.
Download
Filename: mariavincitbpt.zip
Filesize: 133.45 KB
Downloaded: 135 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: 570
Location: Belarus
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: 495
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: 495
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: 232
Location: Poland
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-2019, Tomasz Grysztar.

Powered by rwasa.