flat assembler
Message board for the users of flat assembler.
Index
> Tutorials and Examples > Depth independent transparency. |
Author |
|
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 |
|||
18 Jan 2019, 13:56 |
|
comrade 20 Jan 2019, 05:41
Very beautiful!!
|
|||
20 Jan 2019, 05:41 |
|
Roman 20 Jan 2019, 09:15
I try download but google chrome do not open two links.
|
|||
20 Jan 2019, 09:15 |
|
macgub 20 Jan 2019, 14:40
@comrade
I am glad you like it @Roman Maybye try firefox or explorer ? Anyway I attached both files to, perhaps, easier downloading.
|
||||||||||||||||||||
20 Jan 2019, 14:40 |
|
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 |
|||
21 Jan 2019, 13:56 |
|
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. |
|||
21 Jan 2019, 14:02 |
|
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 |
|||
21 Jan 2019, 17:40 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.