flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2, 3, 4, 5 Next |
Author |
|
macgub
I ported (partially) my view3ds app for MenuetOS. For now it support several displaying models, please use SPACE key for switching, also make random lights (use TAB) and zoom in/out (use +/- keys).
Until them, enjoy... ![]() http://macgub.co.pl/win/win3ds00.zip ![]() Last edited by macgub on 16 Jan 2022, 16:13; edited 4 times in total |
|||
![]() |
|
macgub
win3ds01 - I added several sse4.1 optimizations (using "pblendvb" instruction). When you haven't sse4.1 machine you can use sse2 version but it slower than completly unoptimized x86 code ("maskmovdqu" instruction I used to, operates on non temporal variables). I added viewing edges only drawing model, which plots smooth shaded wire-frame. All without OpenGL touching.
http://macgub.co.pl/win/win3ds01.zip Last edited by macgub on 16 Jan 2022, 16:13; edited 3 times in total |
|||
![]() |
|
comrade
Niiicceee!!
|
|||
![]() |
|
randall
Great work!
|
|||
![]() |
|
macgub
Thanks guys for your opinions.
![]() |
|||
![]() |
|
macgub
Win3ds02. I added ability load external .3ds file. (App open dialog at start). I implemented on/off motion blur option (press F1 key) and play with float Zbuffer coordinates also using AVX instructions -> flat shading, last drawing model; but it decreases app speed
![]() app: http://macgub.co.pl/win/win3ds02.zip a few 3ds objects: http://macgub.co.pl/menuet/3ds_view/3ds_objects.tgz Last edited by macgub on 16 Jan 2022, 16:14; edited 3 times in total |
|||
![]() |
|
macgub
Win3ds03. I added new displaying models based on textured lines (Press space several times). Texture can be like in environment mapping or red-white stripes like in texture mapping displaying model). I added also predefined 3d model as an alternative to model loaded from file (switching beetwen models after hit F2).
http://macgub.co.pl/win/win3ds03.zip -> application http://macgub.co.pl/menuet/3ds_view/3ds_objects.tgz -> sample 3d objects ![]() Last edited by macgub on 16 Jan 2022, 16:14; edited 3 times in total |
|||
![]() |
|
Roman
macgub
Good work ! I know how not easy to write such code. Be stubborn and believe in yourself ! You can write an article on how load 3ds model. |
|||
![]() |
|
cod3b453
It's stuff like this that makes me wish I had a CPU with AVX...
![]() ![]() |
|||
![]() |
|
macgub
@ Roman
Oops, my mistake the code witch load 3ds file contains about 100 lines. Code: read_from_file: fninit mov edi,triangles ; triangles -> contains lsit of polygons xor ebx,ebx ; each poligon 3 word integer -index ; to points_r xor ebp,ebp mov [points_count_var],0 mov [triangles_count_var],0 mov esi,[File_ptr] cmp [esi],word 4D4Dh jne .exit ;Must be legal .3DS file mov eax,dword[esi+2] ; cmp eax,[fsize] ; jne .exit add eax,esi mov [EndFile],eax ; add esi,6 @@: cmp [esi],word 3D3Dh je @f add esi,[esi+2] jmp @b @@: add esi,6 .find4k: cmp [esi],word 4000h je @f add esi,[esi+2] cmp esi,[EndFile] jc .find4k jmp .exit @@: add esi,6 @@: cmp [esi],byte 0 je @f inc esi jmp @b @@: inc esi @@: cmp [esi],word 4100h je @f add esi,[esi+2] jmp @b @@: add esi,6 @@: cmp [esi],word 4110h je @f add esi,[esi+2] jmp @b @@: movzx ecx,word[esi+6] add [points_count_var],cx mov edx,ecx add esi,8 @@: push edi mov edi,points_r ; each point 3 dwords float -> x, y, z push dword[esi+4] pop dword[edi+ebx*2+0] push dword[esi+8] pop dword[edi+ebx*2+4] push dword[esi+0] pop dword[edi+ebx*2+8] pop edi add ebx,6 add esi,12 dec ecx jnz @b @@: push edi mov edi,points_r mov dword[edi+ebx*2],-1 ; end mark (not always in use) pop edi @@: cmp [esi],word 4120h je @f add esi,[esi+2] jmp @b @@: movzx ecx,word[esi+6] add [triangles_count_var],cx add esi,8 @@: movsd movsw add word[edi-6],bp add word[edi-4],bp add word[edi-2],bp add esi,2 dec ecx jnz @b add ebp,edx jmp .find4k mov eax,-1 ;<---mark if OK .exit: mov dword[edi],-1 ret @Cod AVX version is not so fast like you expected, its rather slowly than sse2 version. It was only first try ![]() |
|||
![]() |
|
Roman
how about texture? When support textures ?
Best way to direct you work to ray tracing and global illumination. Because video cards very fast display 3d models and textures. But raytracing helpfull on CPU witch AVX or SSE4 |
|||
![]() |
|
macgub
All textured are generated. I don't load texture from file.
|
|||
![]() |
|
macgub
Win3ds04 can produce images like this:
![]() I implemented bumps map texture dependent, fixed bug badly textured lines, plain lines without z coordinate interpolation (code posted some time ago by PabloReda) etc... http://macgub.co.pl/win/win3ds04.zip Last edited by macgub on 16 Jan 2022, 16:14; edited 5 times in total |
|||
![]() |
|
catafest
@macgub
try to use shaders ... also cuda implementation will be great ... also clean your code ... (sorry about this ...) |
|||
![]() |
|
Fixit
Excellent graphics and detail.
![]() |
|||
![]() |
|
macgub
Thanks for your replies. Unfortunatelly my hardware don't suport CUDA. Also using shaders is for me rather difficult, any example ?
|
|||
![]() |
|
macgub
I added editor wich produce solid object using rotared bezier curve. Result is displayed on fly. Editor mode avialable after pressing F2 key several times.
http://macgub.co.pl/win/win3ds05.zip Last edited by macgub on 16 Jan 2022, 16:15; edited 3 times in total |
|||
![]() |
|
macgub
I added *.asc models support, read and write. To write current object to object.asc file press F8.
http://www.macgub.co.pl/win/win3ds06.zip - binaries and sources. http://www.macgub.co.pl/win/asc_objects.zip - example asc objects Last edited by macgub on 16 Jan 2022, 16:15; edited 3 times in total |
|||
![]() |
|
Mikl___
Hi, macgub !
binary and source
|
||||||||||||||||||||
![]() |
|
Goto page 1, 2, 3, 4, 5 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.