forked from KolibriOS/kolibrios
view3ds 0073 by macgub
git-svn-id: svn://kolibrios.org@8719 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
1c24cac315
commit
73122f1cb1
@ -198,24 +198,7 @@ ret
|
||||
;---------------------------- edi - pointer to vector -----
|
||||
;----------------------- out : none
|
||||
normalize_vector:
|
||||
if Ext = SSE2 | Ext = SSE | Ext = SSE3
|
||||
movups xmm0,[edi]
|
||||
andps xmm0,[zero_hgst_dd]
|
||||
movups xmm1,xmm0
|
||||
mulps xmm0,xmm0
|
||||
movhlps xmm2,xmm0
|
||||
addps xmm0,xmm2
|
||||
movaps xmm2,xmm0
|
||||
shufps xmm2,xmm2,11100001b
|
||||
addps xmm0,xmm2
|
||||
shufps xmm0,xmm0,0
|
||||
rsqrtps xmm0,xmm0
|
||||
mulps xmm0,xmm1
|
||||
movlps [edi],xmm0
|
||||
movhlps xmm0,xmm0
|
||||
movss [edi+8],xmm0
|
||||
end if
|
||||
if 0 ; Ext >= SSE3
|
||||
if Ext >= SSE3
|
||||
movups xmm0,[edi]
|
||||
andps xmm0,[zero_hgst_dd]
|
||||
movups xmm1,xmm0
|
||||
@ -227,8 +210,7 @@ if 0 ; Ext >= SSE3
|
||||
movlps [edi],xmm0
|
||||
movhlps xmm0,xmm0
|
||||
movss [edi+8],xmm0
|
||||
end if
|
||||
if Ext < SSE
|
||||
else
|
||||
|
||||
fninit
|
||||
fld dword [edi+vec_x]
|
||||
|
@ -312,9 +312,11 @@ stencil_line:
|
||||
sub ecx,.x1
|
||||
movss xmm2,.z1 ; cz
|
||||
.ccalc:
|
||||
; movss xmm1,xmm2
|
||||
comiss xmm2,dword[esi]
|
||||
jg @f
|
||||
movss xmm1,xmm2
|
||||
cmpltss xmm1,dword[esi]
|
||||
movd eax,xmm1
|
||||
cmp eax,-1
|
||||
jnz @f
|
||||
movss dword[esi],xmm2
|
||||
@@:
|
||||
add esi,4
|
||||
|
@ -1,3 +1,227 @@
|
||||
;===============================================================
|
||||
do_edges_list:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
sub esp,32
|
||||
|
||||
.ed_cnt equ [ebp-4]
|
||||
.edd_ptr equ [ebp-8]
|
||||
.counter equ [ebp-12]
|
||||
|
||||
|
||||
mov ebx,[edges_ptr]
|
||||
mov eax,[triangles_ptr]
|
||||
mov ecx,[triangles_count_var]
|
||||
@@:
|
||||
movdqu xmm0,[eax]
|
||||
movq [ebx],xmm0
|
||||
pshufd xmm0,xmm0,11001001b
|
||||
movq [ebx+8],xmm0
|
||||
pshufd xmm0,xmm0,11001001b
|
||||
movq [ebx+16],xmm0
|
||||
add ebx,24
|
||||
add eax,12
|
||||
loop @b
|
||||
|
||||
|
||||
mov ebx,[edges_ptr]
|
||||
mov ecx,[triangles_count_var]
|
||||
lea ecx,[ecx*3]
|
||||
.mxd:
|
||||
mov eax,[ebx]
|
||||
cmp eax,[ebx+4]
|
||||
jl @f
|
||||
movq xmm0,[ebx]
|
||||
pshufd xmm0,xmm0,11100001b
|
||||
movq [ebx],xmm0
|
||||
@@:
|
||||
add ebx,8
|
||||
loop .mxd
|
||||
|
||||
|
||||
; insert sort
|
||||
mov ebx,[edges_ptr]
|
||||
mov ecx,[triangles_count_var]
|
||||
lea ecx,[ecx*3]
|
||||
|
||||
mov esi,ecx
|
||||
shl esi,3
|
||||
add esi,ebx
|
||||
|
||||
.ccc:
|
||||
mov eax,[ebx+8]
|
||||
cmp eax,[ebx]
|
||||
jge .g
|
||||
movq xmm0,[ebx+8]
|
||||
push ebx
|
||||
.c:
|
||||
cmp ebx,esi
|
||||
jge .done
|
||||
cmp ebx,[edges_ptr]
|
||||
jl .done
|
||||
cmp eax,[ebx]
|
||||
jge .done
|
||||
movq xmm7,[ebx]
|
||||
movq [ebx+8],xmm7
|
||||
sub ebx,8
|
||||
jnz .c
|
||||
add ebx,8
|
||||
.done:
|
||||
movq [ebx+8],xmm0
|
||||
.p:
|
||||
pop ebx
|
||||
.g:
|
||||
add ebx,8
|
||||
dec ecx
|
||||
cmp ecx,1
|
||||
jnz .ccc
|
||||
|
||||
|
||||
; insert sort again
|
||||
mov ebx,[edges_ptr]
|
||||
mov ecx,[triangles_count_var]
|
||||
lea ecx,[ecx*3]
|
||||
mov esi,ecx
|
||||
shl esi,3
|
||||
add esi,ebx
|
||||
|
||||
.count:
|
||||
push ecx
|
||||
push ebx
|
||||
xor ecx,ecx
|
||||
mov eax,[ebx] ; count
|
||||
.aa:
|
||||
inc ecx
|
||||
add ebx,8
|
||||
cmp ebx,esi
|
||||
jge .br ; break
|
||||
cmp eax,[ebx]
|
||||
je .aa
|
||||
mov .counter,ecx
|
||||
pop ebx
|
||||
mov edi,ebx
|
||||
sub edi,8
|
||||
mov edx,[ebx+8]
|
||||
.ccc2:
|
||||
|
||||
cmp ebx,esi
|
||||
jbe @f
|
||||
add esp,4
|
||||
jmp .ff
|
||||
@@:
|
||||
mov eax,[ebx+12]
|
||||
mov edx,[ebx+8]
|
||||
cmp eax,[ebx+4]
|
||||
jge .gg2
|
||||
movq xmm0,[ebx+8]
|
||||
push ebx
|
||||
.c2:
|
||||
cmp eax,[ebx+4]
|
||||
jge .done2
|
||||
movq xmm7,[ebx]
|
||||
movq [ebx+8],xmm7
|
||||
|
||||
sub ebx,8
|
||||
cmp ebx,edi
|
||||
jz @f
|
||||
cmp [ebx+8],edx
|
||||
jz .c2
|
||||
@@:
|
||||
.done2:
|
||||
add ebx,8
|
||||
movq [ebx],xmm0
|
||||
|
||||
.p2:
|
||||
pop ebx
|
||||
.gg2:
|
||||
add ebx,8
|
||||
dec ecx
|
||||
cmp ecx,1
|
||||
jnz .ccc2
|
||||
|
||||
pop ecx
|
||||
sub ecx,.counter
|
||||
add ebx,8
|
||||
ja .count
|
||||
|
||||
jmp .ff
|
||||
.br: ;break
|
||||
add esp,8
|
||||
.ff:
|
||||
|
||||
; count edges
|
||||
mov ecx,0
|
||||
mov edx,[triangles_count_var]
|
||||
lea edx,[edx*3]
|
||||
mov ebx,[edges_ptr]
|
||||
; mov esi,edx
|
||||
; shl esi,3
|
||||
; add esi,[edges_ptr]
|
||||
.nx:
|
||||
movq xmm0,[ebx]
|
||||
add ebx,8
|
||||
; cmp ebx,esi
|
||||
; jae @f
|
||||
movq xmm1,[ebx]
|
||||
; @@:
|
||||
pcmpeqd xmm0,xmm1
|
||||
pmovmskb eax,xmm0
|
||||
and eax,0xff
|
||||
cmp eax,0xff
|
||||
jz @f
|
||||
inc ecx
|
||||
@@:
|
||||
dec edx
|
||||
jnz .nx
|
||||
|
||||
|
||||
mov .ed_cnt,ecx
|
||||
lea ecx,[ecx*3]
|
||||
shl ecx,2
|
||||
add ecx,65536
|
||||
mov ebx,12
|
||||
mov eax,68
|
||||
mov edx,.edd_ptr
|
||||
int 0x40 ; -> allocate memory to triangles
|
||||
mov .edd_ptr, eax ; -> eax = pointer to allocated mem
|
||||
|
||||
|
||||
|
||||
mov ebx,[edges_ptr]
|
||||
mov ecx,[triangles_count_var]
|
||||
lea ecx,[ecx*3]
|
||||
.seek:
|
||||
movq xmm0,[ebx]
|
||||
movq xmm1,[ebx+8]
|
||||
pcmpeqd xmm1,xmm0
|
||||
pmovmskb edx,xmm1
|
||||
and edx,0xff
|
||||
cmp edx,0xff
|
||||
je @f
|
||||
movq [eax],xmm0
|
||||
add eax,8
|
||||
@@:
|
||||
add ebx,8
|
||||
loop .seek
|
||||
|
||||
mov eax,68
|
||||
mov ebx,13
|
||||
mov ecx,[edges_ptr]
|
||||
int 0x40 ; release old edges ptr
|
||||
|
||||
|
||||
mov eax,.edd_ptr
|
||||
mov ecx,.ed_cnt
|
||||
mov [edges_ptr],eax
|
||||
mov [edges_count],ecx
|
||||
|
||||
mov esp,ebp
|
||||
pop ebp
|
||||
ret
|
||||
|
||||
;=======================
|
||||
|
||||
|
||||
do_sinus:
|
||||
.x equ [ebp-8]
|
||||
.y equ [ebp-12]
|
||||
@ -19,21 +243,53 @@ do_sinus:
|
||||
cld
|
||||
rep stosd
|
||||
pop edi
|
||||
; movzx eax,[sinus_flag]
|
||||
; mov edx,10
|
||||
; mul edx
|
||||
; mov [sin_amplitude],eax
|
||||
; mov [sin_frq],eax
|
||||
fninit
|
||||
;if Ext = SSE2
|
||||
; movups xmm1,[const0123] ; xmm1 - init values
|
||||
; mov eax,0x000000ff
|
||||
; movd xmm2,eax
|
||||
; shufps xmm2,xmm2,0 ; xmm2 - mask value
|
||||
; mov eax,4
|
||||
; movd xmm3,eax
|
||||
; shufps xmm3,xmm3,0
|
||||
.again:
|
||||
if 0
|
||||
fild dword .x
|
||||
fidiv [sin_frq]
|
||||
fsin
|
||||
fimul [sin_amplitude]
|
||||
fiadd dword .y
|
||||
fistp dword .new_y
|
||||
else
|
||||
fild dword .x
|
||||
fmul [sin_frq]
|
||||
fistp dword .temp
|
||||
mov eax, .temp
|
||||
; mov bx, [angle_x]
|
||||
; add bx, [angle_y]
|
||||
; movzx ebx,bx
|
||||
; shr ebx,1 ; change phase
|
||||
; add eax,ebx
|
||||
|
||||
|
||||
and eax, 0x000000ff
|
||||
|
||||
; cdq
|
||||
; mul [sin_frq]
|
||||
; and eax,0x000000ff
|
||||
; and ax,0x00ff
|
||||
; cwde
|
||||
|
||||
fld dword [sin_tab+eax*4]
|
||||
fimul dword [sin_amplitude]
|
||||
fiadd dword .y
|
||||
fistp dword .new_y
|
||||
|
||||
end if
|
||||
mov eax,.new_y
|
||||
or eax,eax
|
||||
jl .skip
|
||||
@ -244,7 +500,109 @@ end if
|
||||
|
||||
ret
|
||||
|
||||
;align 16
|
||||
; emboss_bias:
|
||||
; dw 128, 128, 128, 128, 128, 128, 128, 128
|
||||
|
||||
if 0 ; old emb proc
|
||||
|
||||
; emboss - after drawing all,
|
||||
; transfer screen buffer into bump map
|
||||
; and draw two bump triangles
|
||||
; *************************************
|
||||
mov esi,screen
|
||||
mov edi,bumpmap2
|
||||
mov ecx,TEXTURE_SIZE/3
|
||||
cld
|
||||
if Ext=NON
|
||||
xor eax,eax
|
||||
xor bh,bh
|
||||
xor dh,dh
|
||||
@@:
|
||||
lodsb
|
||||
movzx bx,al
|
||||
lodsb
|
||||
movzx dx,al
|
||||
lodsb
|
||||
add ax,bx
|
||||
add ax,dx
|
||||
; cwd
|
||||
; div [i3]
|
||||
;; push ax
|
||||
;; pop bx
|
||||
;; shr bx,3
|
||||
;; shr ax,2
|
||||
;; add ax,bx
|
||||
|
||||
lea eax,[eax*5]
|
||||
shr ax,4
|
||||
|
||||
stosb
|
||||
loop @b
|
||||
else
|
||||
emms
|
||||
pxor mm1,mm1
|
||||
mov ebx,0x0000ffff
|
||||
@@:
|
||||
movd mm0,[esi]
|
||||
punpcklbw mm0,mm1
|
||||
movq mm2,mm0
|
||||
psrlq mm2,16
|
||||
movq mm3,mm0
|
||||
psrlq mm3,32
|
||||
paddw mm0,mm2
|
||||
paddw mm0,mm3
|
||||
|
||||
|
||||
movd eax,mm0
|
||||
and eax,ebx
|
||||
lea eax,[eax*5]
|
||||
shr ax,4
|
||||
stosb
|
||||
add esi,3
|
||||
loop @b
|
||||
|
||||
end if
|
||||
push ebp
|
||||
|
||||
push dword 0 ; env coords
|
||||
push word 0
|
||||
push word SIZE_X
|
||||
push word SIZE_Y
|
||||
push dword 0
|
||||
push dword 0 ; bump coords
|
||||
push word SIZE_X
|
||||
push word SIZE_Y
|
||||
push word 0
|
||||
mov eax,SIZE_Y
|
||||
mov ebx,SIZE_X*65536+0
|
||||
xor ecx,ecx
|
||||
mov edx,bumpmap2
|
||||
mov esi,envmap
|
||||
mov edi,screen
|
||||
call bump_triangle
|
||||
|
||||
push dword SIZE_X shl 16 + SIZE_Y ; env coords
|
||||
push word 0
|
||||
push word SIZE_X
|
||||
push word SIZE_Y
|
||||
push word 0
|
||||
push dword SIZE_X shl 16 + SIZE_Y ; bump coords
|
||||
push word 0
|
||||
push word SIZE_X
|
||||
push word SIZE_Y
|
||||
push word 0
|
||||
mov eax,SIZE_Y
|
||||
mov ebx,SIZE_X * 65536+0
|
||||
mov ecx,SIZE_X shl 16 + SIZE_Y
|
||||
mov edx,bumpmap2
|
||||
mov esi,envmap
|
||||
mov edi,screen
|
||||
call bump_triangle
|
||||
|
||||
pop ebp
|
||||
ret
|
||||
end if
|
||||
;********************************EMBOSS DONE*******************************
|
||||
|
||||
|
||||
|
@ -60,25 +60,24 @@ calc_one_col:
|
||||
; stack - other parameters
|
||||
; out - eax - 0x00rrggbb
|
||||
.dot_prd equ dword[ebp+4] ; dot product - cos x - not now
|
||||
.min_col_r equ [ebp+8] ; minimum color - ambient
|
||||
.min_col_r equ word[ebp+8] ; minimum color - ambient
|
||||
.min_col_g equ word[ebp+10]
|
||||
.min_col_b equ word[ebp+12]
|
||||
.max_col_r equ [ebp+14] ; maximum color - specular
|
||||
.max_col_r equ word[ebp+14] ; maximum color - specular
|
||||
.max_col_g equ word[ebp+16]
|
||||
.max_col_b equ word[ebp+18]
|
||||
.org_col_r equ [ebp+20] ; orginal color - diffuse
|
||||
.org_col_r equ word[ebp+20] ; orginal color - diffuse
|
||||
.org_col_g equ word[ebp+22]
|
||||
.org_col_b equ word[ebp+24]
|
||||
.n equ word[ebp+26] ; shines - not implemented
|
||||
.temp equ word[ebp-2]
|
||||
.color_sum_r equ [ebp-6]
|
||||
.color_sum_g equ [ebp-10]
|
||||
.color_sum_b equ [ebp-14]
|
||||
.color_sum_r equ dword[ebp-6]
|
||||
.color_sum_g equ dword[ebp-10]
|
||||
.color_sum_b equ dword[ebp-14]
|
||||
; color = ambient+cos(x)*diffuse+(cos(x)^n)*specular
|
||||
mov ebp,esp
|
||||
sub esp,14
|
||||
|
||||
|
||||
mov ax,.min_col_r
|
||||
add ax,.max_col_r
|
||||
add ax,.org_col_r
|
||||
@ -96,38 +95,8 @@ calc_one_col:
|
||||
add ax,.org_col_b
|
||||
cwde
|
||||
mov .color_sum_b,eax
|
||||
if 0
|
||||
|
||||
|
||||
movq xmm0,.min_col_r
|
||||
movq xmm1,.max_col_r
|
||||
movq xmm2,.org_col_r
|
||||
packuswb xmm0,[the_zero]
|
||||
packuswb xmm1,[the_zero]
|
||||
packuswb xmm2,[the_zero]
|
||||
punpcklbw xmm0,xmm1
|
||||
punpcklbw xmm2,[the_zero]
|
||||
packusdw xmm2,[the_zero]
|
||||
cvtdq2ps xmm0,xmm0
|
||||
cvtdq2ps xmm1,xmm1
|
||||
cvtdq2ps xmm2,xmm2
|
||||
haddps xmm0,xmm0
|
||||
haddps xmm1,xmm1
|
||||
haddps xmm2,xmm2
|
||||
haddps xmm0,xmm0
|
||||
haddps xmm1,xmm1
|
||||
haddps xmm2,xmm2
|
||||
|
||||
cvtss2si eax,xmm0
|
||||
cvtss2si ebx,xmm1
|
||||
cvtss2si ecx,xmm2
|
||||
mov .color_sum_r,eax
|
||||
mov .color_sum_g,ebx
|
||||
mov .color_sum_b,ecx
|
||||
|
||||
|
||||
end if
|
||||
|
||||
; fld .dot_prd
|
||||
; fild .n
|
||||
; fxch st1
|
||||
@ -154,7 +123,7 @@ end if
|
||||
faddp ; st0=first piece of col, st1=dot_pr^n..
|
||||
fiadd .min_col_b
|
||||
fimul .max_col_b
|
||||
fidiv dword .color_sum_b
|
||||
fidiv .color_sum_b
|
||||
fistp .temp
|
||||
movzx eax,.temp
|
||||
shl eax,16
|
||||
@ -166,19 +135,19 @@ end if
|
||||
faddp
|
||||
fiadd .min_col_g
|
||||
fimul .max_col_g
|
||||
fidiv dword .color_sum_g
|
||||
fidiv .color_sum_g
|
||||
fistp .temp
|
||||
mov ax,.temp
|
||||
mov ah,al
|
||||
shl eax,8
|
||||
|
||||
fimul word .max_col_r
|
||||
fild word .org_col_r
|
||||
fimul .max_col_r
|
||||
fild .org_col_r
|
||||
fmulp st2,st
|
||||
faddp
|
||||
fiadd word .min_col_r
|
||||
fimul word .max_col_r
|
||||
fidiv dword .color_sum_r
|
||||
fiadd .min_col_r
|
||||
fimul .max_col_r
|
||||
fidiv .color_sum_r
|
||||
fistp .temp
|
||||
mov ax,.temp ;eax - 0xbbgg00rr
|
||||
; mov ah,al
|
||||
|
@ -1,12 +1,15 @@
|
||||
; DATA AREA ************************************
|
||||
|
||||
i3 dw 3
|
||||
i6 dd 6
|
||||
i12 dd 12
|
||||
i36 dd 36
|
||||
i256 dw 256
|
||||
i255d dd 255
|
||||
dot_max dd 1.0 ; dot product max and min
|
||||
dot_min dd 0.0
|
||||
env_const dd 1.05
|
||||
correct_tex dw 255
|
||||
tex_x_div2 dw TEX_X / 2
|
||||
tex_y_div2 dw TEX_Y / 2
|
||||
xobs dw 0 ;SIZE_X / 2 ;200 ;observer = camera
|
||||
@ -54,6 +57,7 @@
|
||||
points_ptr dd 0
|
||||
points_rotated_ptr dd 0
|
||||
points_translated_ptr dd 0
|
||||
edges_ptr dd 0
|
||||
screen_ptr dd 0
|
||||
Zbuffer_ptr dd 0
|
||||
vertices_index_ptr dd 0
|
||||
@ -64,6 +68,9 @@
|
||||
edit_end_x:
|
||||
dw 0
|
||||
edit_end_y dw 0
|
||||
x_start: dw 20
|
||||
y_start: dw 20
|
||||
|
||||
mouse_state dd 0
|
||||
|
||||
|
||||
@ -343,9 +350,19 @@ base_vector:
|
||||
if Ext=SSE3
|
||||
db ' (SSE3)'
|
||||
end if
|
||||
db ' 0.072',0
|
||||
db ' 0.073',0
|
||||
labellen:
|
||||
STRdata db '-1 '
|
||||
lab_vert:
|
||||
db 'Vertices count: '
|
||||
lab_vert_end:
|
||||
lab_tr:
|
||||
db 'Faces count: '
|
||||
lab_tr_end:
|
||||
lab_ed:
|
||||
db 'Edges count: '
|
||||
lab_ed_end:
|
||||
|
||||
|
||||
all_lights_size dw lightsend-lights
|
||||
|
||||
@ -410,6 +427,8 @@ lightsend:
|
||||
|
||||
|
||||
align 16
|
||||
abs_mask:
|
||||
dd 0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff
|
||||
emboss_bias:
|
||||
dw 128, 128, 128, 128, 128, 128, 128, 128
|
||||
zero_hgst_dd:
|
||||
@ -434,7 +453,7 @@ align 16
|
||||
fptr dd 0 ;workarea
|
||||
file_name:
|
||||
db '/rd/1/3d/house.3ds',0
|
||||
; db '/tmp0/1/ant.3ds',0
|
||||
; db '/tmp0/1/ant.3ds',0
|
||||
|
||||
rb 256
|
||||
|
||||
@ -465,21 +484,9 @@ align 8
|
||||
col3 dd ?
|
||||
scale dd ? ; help scale variable
|
||||
|
||||
;==
|
||||
triangles_count_var dd ?
|
||||
points_count_var dd ?
|
||||
|
||||
; size_y_var:
|
||||
; yres_var dw ?
|
||||
|
||||
; size_x_var:
|
||||
; xres_var dw ?
|
||||
x_start:
|
||||
dw ?
|
||||
y_start:
|
||||
dw ?
|
||||
|
||||
;===
|
||||
points_count_var dd ? ;
|
||||
triangles_count_var dd ? ; dont change order
|
||||
edges_count dd ? ;
|
||||
|
||||
point_index1 dd ? ;-\
|
||||
point_index2 dd ? ; } don't change order
|
||||
|
@ -1,643 +1,115 @@
|
||||
;-procedure draws smooth shaded lines (I mean interpolation 24 bit--
|
||||
;-color), with z coord interpolation--------------------------------
|
||||
;-author: Maciej Guba (www.macgub.hekko.pl)-------------------------
|
||||
;-in : -------------------------------------------------------------
|
||||
;----- edi - pointer to screen buffer ------------------------------
|
||||
;----- esi - pointer to Z buffer -----------------------------------
|
||||
;------ constans : SIZE_X, SIZE_Y - screen width and height---------
|
||||
;----------------- ROUND - fixed point shift------------------------
|
||||
;------ other parameters via stack----------------------------------
|
||||
smooth_line:
|
||||
.x1 equ ebp+4
|
||||
.y1 equ ebp+6
|
||||
.z1 equ ebp+8
|
||||
.r1 equ ebp+10
|
||||
.g1 equ ebp+12
|
||||
.b1 equ ebp+14
|
||||
.x2 equ ebp+16
|
||||
.y2 equ ebp+18
|
||||
.z2 equ ebp+20
|
||||
.r2 equ ebp+22
|
||||
.g2 equ ebp+24
|
||||
.b2 equ ebp+26
|
||||
|
||||
|
||||
.line_lenght equ ebp-2
|
||||
.delta equ ebp-6
|
||||
.delta_x equ ebp-10
|
||||
.delta_y equ ebp-14
|
||||
.dr equ ebp-18
|
||||
.dg equ ebp-22
|
||||
.db equ ebp-26
|
||||
.dz equ ebp-30
|
||||
.cr equ ebp-34
|
||||
.cg equ ebp-38
|
||||
.cb equ ebp-42
|
||||
.cz equ ebp-46
|
||||
|
||||
;.line_lenght equ ebp-48
|
||||
.screen equ ebp-52
|
||||
.zbuffer equ ebp-56
|
||||
.ccoord equ ebp-60 ;current coordinate
|
||||
.czbuf equ ebp-64
|
||||
.cscr equ ebp-68
|
||||
.xres equ ebp-72
|
||||
.yres equ ebp-76
|
||||
.xresm1 equ ebp-80
|
||||
.yresm1 equ ebp-84
|
||||
.xresp1 equ ebp-88
|
||||
.yresp1 equ ebp-92
|
||||
.xres3 equ ebp-96
|
||||
.xres4 equ ebp-100
|
||||
|
||||
macro .update_cur_var
|
||||
{
|
||||
if Ext=NON
|
||||
mov ebx,[.dz]
|
||||
add [.cz],ebx
|
||||
mov ebx,[.dr]
|
||||
add [.cr],ebx
|
||||
mov ebx,[.dg]
|
||||
add [.cg],ebx
|
||||
mov ebx,[.db]
|
||||
add [.cb],ebx
|
||||
elseif Ext=MMX
|
||||
movq mm0,[.cz]
|
||||
movq mm1,[.cg]
|
||||
paddd mm0,mm2 ;[.dz]
|
||||
paddd mm1,mm3 ;[.dg]
|
||||
movq [.cz],mm0
|
||||
movq [.cg],mm1
|
||||
elseif Ext >= SSE2
|
||||
; movups xmm1,[.cz]
|
||||
paddd xmm1,xmm0
|
||||
; movups [.cz],xmm1
|
||||
end if
|
||||
}
|
||||
macro .draw_pixel
|
||||
{
|
||||
mov [esi],ebx ; actualize Z buffer
|
||||
if Ext>=SSE2
|
||||
movaps xmm7,xmm1 ;[.cb] ;;xmm1
|
||||
shufps xmm7,xmm7,00111001b
|
||||
psrld xmm7,ROUND
|
||||
packssdw xmm7,xmm7
|
||||
packuswb xmm7,xmm7
|
||||
pand xmm7,xmm6 ;[.mask]
|
||||
movd [edi],xmm7
|
||||
else
|
||||
|
||||
mov eax,[.cb]
|
||||
sar eax,ROUND
|
||||
mov [edi],al
|
||||
; and eax,0x000000ff ; clean unused bits
|
||||
mov ebx,[.cg]
|
||||
sar ebx,ROUND
|
||||
mov [edi+1],bl
|
||||
; mov ah,bl
|
||||
mov edx,[.cr]
|
||||
sar edx,ROUND
|
||||
mov [edi+2],dl
|
||||
end if
|
||||
; shl ebx,16
|
||||
; or eax,ebx
|
||||
; mov [edi],eax
|
||||
}
|
||||
macro .sort
|
||||
{
|
||||
|
||||
if Ext >= MMX
|
||||
movq mm0,[.x1]
|
||||
movq mm1,[.x2]
|
||||
movq [.x1],mm1
|
||||
movq [.x2],mm0
|
||||
else
|
||||
mov edx,[.x1]
|
||||
xchg edx,[.x2]
|
||||
mov [.x1],edx
|
||||
mov edx,[.z1]
|
||||
xchg edx,[.z2]
|
||||
mov [.z1],edx
|
||||
end if
|
||||
mov edx,[.g1]
|
||||
xchg edx,[.g2]
|
||||
mov [.g1],edx
|
||||
}
|
||||
|
||||
|
||||
|
||||
emms
|
||||
mov ebp,esp
|
||||
sub esp,128
|
||||
mov eax,[.x1] ; check if parameters exceedes screen area
|
||||
mov ebx,[.x2]
|
||||
or eax,ebx
|
||||
test eax,80008000h
|
||||
jne .end_line
|
||||
movzx edx,word [size_x_var]
|
||||
mov [.xres],edx
|
||||
dec edx
|
||||
movzx ecx,word [size_y_var]
|
||||
mov [.yres],ecx
|
||||
dec ecx
|
||||
cmp word[.x1],dx ;SIZE_X
|
||||
jg .end_line
|
||||
cmp word[.x2],dx ;SIZE_X
|
||||
jg .end_line
|
||||
cmp word[.y1],cx ;SIZE_Y
|
||||
jg .end_line
|
||||
cmp word[.y2],cx ;SIZE_Y
|
||||
jg .end_line
|
||||
|
||||
mov edx,[.xres]
|
||||
shl edx,2
|
||||
mov [.xres4],edx
|
||||
shr edx,2
|
||||
lea edx,[edx*3]
|
||||
mov [.xres3],edx
|
||||
mov edx,[.xres]
|
||||
mov ecx,[.yres]
|
||||
dec edx
|
||||
dec ecx
|
||||
mov [.xresm1],edx
|
||||
mov [.yresm1],ecx
|
||||
add edx,2
|
||||
add ecx,2
|
||||
mov [.xresp1],edx
|
||||
mov [.yresp1],ecx
|
||||
|
||||
mov [.screen],edi
|
||||
mov cx,[.x1]
|
||||
cmp cx,[.x2]
|
||||
je .vertical_l
|
||||
mov cx,[.y1]
|
||||
cmp cx,[.y2]
|
||||
je .horizontal_l
|
||||
mov ax,[.x1]
|
||||
sub ax,[.x2]
|
||||
cmp ax,0
|
||||
jg @f
|
||||
neg ax ; calc absolute value
|
||||
@@:
|
||||
mov [.delta_x],ax
|
||||
mov bx,[.y1]
|
||||
sub bx,[.y2]
|
||||
cmp bx,0
|
||||
jg @f
|
||||
neg bx
|
||||
@@:
|
||||
mov [.delta_y],bx
|
||||
cmp ax,bx
|
||||
je .deg45_l
|
||||
jl .more_vertical_l
|
||||
jg .more_horizon_l
|
||||
jmp .end_line
|
||||
;
|
||||
.horizontal_l:
|
||||
mov ax,[.x1]
|
||||
mov bx,[.x2]
|
||||
cmp bx,ax
|
||||
jge @f
|
||||
|
||||
.sort
|
||||
@@:
|
||||
|
||||
mov bx,[.x2]
|
||||
sub bx,[.x1]
|
||||
movsx ebx,bx
|
||||
cmp ebx,0 ;line lenght equql 0
|
||||
je .end_line
|
||||
mov [.delta_x],ebx
|
||||
|
||||
call .calc_delta
|
||||
|
||||
mov eax,[.xres] ;SIZE_X
|
||||
movsx ebx,word[.y1]
|
||||
mul ebx
|
||||
add esi,eax
|
||||
lea eax,[eax*3]
|
||||
add esi,eax
|
||||
add edi,eax
|
||||
movsx eax,word[.x1]
|
||||
add esi,eax
|
||||
lea eax,[eax*3]
|
||||
add edi,eax
|
||||
add esi,eax
|
||||
|
||||
mov ecx,[.delta_x]
|
||||
|
||||
movsx ebx,word[.r1]
|
||||
shl ebx,ROUND
|
||||
mov [.cr],ebx
|
||||
movsx ebx,word[.g1]
|
||||
shl ebx,ROUND
|
||||
mov [.cg],ebx
|
||||
movsx ebx,word[.b1]
|
||||
shl ebx,ROUND
|
||||
mov [.cb],ebx
|
||||
movsx ebx,word[.z1]
|
||||
shl ebx,ROUND
|
||||
mov [.cz],ebx
|
||||
if Ext >= SSE2
|
||||
movups xmm1,[.cz]
|
||||
end if
|
||||
.hdraw:
|
||||
if Ext >= SSE2
|
||||
movd ebx,xmm1
|
||||
else
|
||||
mov ebx,[.cz]
|
||||
end if
|
||||
cmp [esi],ebx
|
||||
jle .skip
|
||||
|
||||
.draw_pixel
|
||||
|
||||
.skip:
|
||||
add edi,3
|
||||
add esi,4
|
||||
|
||||
.update_cur_var
|
||||
|
||||
loop .hdraw
|
||||
jmp .end_line
|
||||
|
||||
.vertical_l:
|
||||
mov ax,[.y1]
|
||||
cmp [.y2],ax
|
||||
jge @f
|
||||
|
||||
.sort
|
||||
@@:
|
||||
mov bx,[.y2]
|
||||
sub bx,[.y1]
|
||||
movsx ebx,bx
|
||||
cmp ebx,0
|
||||
je .end_line
|
||||
mov [.delta_y],ebx
|
||||
|
||||
call .calc_delta
|
||||
|
||||
mov eax,[.xres] ;SIZE_X
|
||||
movsx ebx,word[.y1]
|
||||
mul ebx
|
||||
add esi,eax
|
||||
lea eax,[eax*3]
|
||||
add edi,eax
|
||||
add esi,eax
|
||||
movsx eax,word[.x1]
|
||||
add esi,eax
|
||||
lea eax,[eax*3]
|
||||
add esi,eax
|
||||
add edi,eax
|
||||
|
||||
mov ecx,[.delta_y]
|
||||
|
||||
movsx ebx,word[.r1]
|
||||
shl ebx,ROUND
|
||||
mov [.cr],ebx
|
||||
movsx ebx,word[.g1]
|
||||
shl ebx,ROUND
|
||||
mov [.cg],ebx
|
||||
movsx ebx,word[.b1]
|
||||
shl ebx,ROUND
|
||||
mov [.cb],ebx
|
||||
movsx ebx,word[.z1]
|
||||
shl ebx,ROUND
|
||||
mov [.cz],ebx
|
||||
if Ext >= SSE2
|
||||
movups xmm1,[.cz]
|
||||
end if
|
||||
|
||||
.v_draw:
|
||||
if Ext >= SSE2
|
||||
movd ebx,xmm1
|
||||
else
|
||||
mov ebx,[.cz]
|
||||
end if
|
||||
cmp [esi],ebx
|
||||
jle @f
|
||||
|
||||
.draw_pixel
|
||||
|
||||
@@:
|
||||
add edi,[.xres3]
|
||||
add esi,[.xres4]
|
||||
|
||||
.update_cur_var
|
||||
|
||||
loop .v_draw
|
||||
jmp .end_line
|
||||
.deg45_l:
|
||||
mov word[.line_lenght],ax
|
||||
mov ax,[.x1]
|
||||
cmp [.x2],ax
|
||||
jge @f
|
||||
|
||||
.sort
|
||||
@@:
|
||||
mov bx,[.y2]
|
||||
sub bx,[.y1]
|
||||
movsx ebx,bx
|
||||
cmp ebx,0
|
||||
je .end_line
|
||||
mov [.delta_y],ebx
|
||||
mov bx,[.x2]
|
||||
sub bx,[.x1]
|
||||
movsx ebx,bx
|
||||
mov [.delta_x],ebx
|
||||
|
||||
call .calc_delta
|
||||
|
||||
mov eax,[.xres]
|
||||
movsx ebx,word[.y1] ;calc begin values in screen and Z buffers
|
||||
mul ebx
|
||||
lea ebx,[3*eax]
|
||||
add edi,ebx
|
||||
shl eax,2
|
||||
add esi,eax
|
||||
movsx eax,word[.x1]
|
||||
lea ebx,[eax*3]
|
||||
add edi,ebx
|
||||
shl eax,2
|
||||
add esi,eax
|
||||
|
||||
movzx ecx,word[.line_lenght]
|
||||
|
||||
movsx ebx,word[.r1]
|
||||
shl ebx,ROUND
|
||||
mov [.cr],ebx
|
||||
movsx ebx,word[.g1]
|
||||
shl ebx,ROUND
|
||||
mov [.cg],ebx
|
||||
movsx ebx,word[.b1]
|
||||
shl ebx,ROUND
|
||||
mov [.cb],ebx
|
||||
movsx ebx,word[.z1]
|
||||
shl ebx,ROUND
|
||||
mov [.cz],ebx
|
||||
.d45_draw:
|
||||
if Ext >= SSE2
|
||||
movd ebx,xmm1
|
||||
else
|
||||
mov ebx,[.cz]
|
||||
end if
|
||||
cmp [esi],ebx
|
||||
jle @f
|
||||
|
||||
.draw_pixel
|
||||
|
||||
@@:
|
||||
cmp dword[.delta_y],0
|
||||
jl @f
|
||||
add edi,[.xres3] ;SIZE_X*3+3
|
||||
add edi,3
|
||||
add esi,[.xres4] ;SIZE_X*4+4
|
||||
add esi,4
|
||||
jmp .d45_1
|
||||
@@:
|
||||
sub edi,[.xres3] ;(SIZE_X*3)-3
|
||||
sub edi,3
|
||||
sub esi,[.xres4] ;(SIZE_X*4)-4
|
||||
sub esi,4
|
||||
.d45_1:
|
||||
.update_cur_var
|
||||
|
||||
loop .d45_draw
|
||||
jmp .end_line
|
||||
|
||||
.more_vertical_l:
|
||||
mov word[.line_lenght],bx
|
||||
mov ax,[.y1]
|
||||
cmp [.y2],ax
|
||||
jge @f
|
||||
.sort
|
||||
@@:
|
||||
mov bx,[.y2]
|
||||
sub bx,[.y1]
|
||||
movsx ebx,bx
|
||||
cmp ebx,0
|
||||
je .end_line ;=======================
|
||||
mov [.delta_y],ebx
|
||||
|
||||
mov ax,[.x2]
|
||||
sub ax,[.x1]
|
||||
cwde
|
||||
shl eax,ROUND
|
||||
cdq
|
||||
idiv ebx
|
||||
mov [.delta],eax
|
||||
|
||||
call .calc_delta
|
||||
|
||||
mov eax,[.xres] ;SIZE_X
|
||||
movsx ebx,word[.y1] ;calc begin values in screen and Z buffers
|
||||
mul ebx
|
||||
lea ebx,[3*eax]
|
||||
add esi,ebx
|
||||
add esi,eax
|
||||
add edi,ebx
|
||||
mov [.cscr],edi
|
||||
mov [.czbuf],esi
|
||||
|
||||
movzx ecx,word[.line_lenght]
|
||||
|
||||
movsx ebx,word[.r1]
|
||||
shl ebx,ROUND
|
||||
mov [.cr],ebx
|
||||
movsx ebx,word[.g1]
|
||||
shl ebx,ROUND
|
||||
mov [.cg],ebx
|
||||
movsx ebx,word[.b1]
|
||||
shl ebx,ROUND
|
||||
mov [.cb],ebx
|
||||
movsx ebx,word[.z1]
|
||||
shl ebx,ROUND
|
||||
mov [.cz],ebx
|
||||
if Ext >= SSE2
|
||||
movups xmm1,[.cz]
|
||||
end if
|
||||
movsx ebx,word[.x1]
|
||||
shl ebx,ROUND
|
||||
mov [.ccoord],ebx ; .ccoord -> x coordinate
|
||||
.draw_m_v:
|
||||
mov edi,[.cscr]
|
||||
mov esi,[.czbuf]
|
||||
mov eax,[.ccoord]
|
||||
sar eax,ROUND
|
||||
lea ebx,[eax*3]
|
||||
add edi,ebx
|
||||
add esi,ebx
|
||||
add esi,eax
|
||||
if Ext >= SSE2
|
||||
movd ebx,xmm1
|
||||
else
|
||||
mov ebx,[.cz]
|
||||
end if
|
||||
cmp [esi],ebx
|
||||
jle @f
|
||||
|
||||
.draw_pixel
|
||||
|
||||
@@:
|
||||
mov eax,[.delta]
|
||||
mov ebx,[.xres3]
|
||||
add [.ccoord],eax
|
||||
mov eax,[.xres4]
|
||||
add dword[.cscr],ebx ;SIZE_X*3 ;
|
||||
add dword[.czbuf],eax ;SIZE_X*4
|
||||
.d_m_v1:
|
||||
|
||||
.update_cur_var
|
||||
|
||||
dec ecx
|
||||
jnz .draw_m_v
|
||||
jmp .end_line
|
||||
|
||||
.more_horizon_l:
|
||||
mov word[.line_lenght],ax
|
||||
mov ax,[.x1]
|
||||
cmp [.x2],ax
|
||||
jge @f
|
||||
|
||||
.sort
|
||||
@@:
|
||||
mov bx,[.x2]
|
||||
sub bx,[.x1]
|
||||
movsx ebx,bx
|
||||
cmp ebx,0;=======================
|
||||
je .end_line
|
||||
mov [.delta_x],ebx
|
||||
|
||||
mov ax,[.y2]
|
||||
sub ax,[.y1]
|
||||
cwde
|
||||
shl eax,ROUND
|
||||
cdq
|
||||
idiv ebx
|
||||
mov [.delta],eax
|
||||
|
||||
call .calc_delta
|
||||
|
||||
;calc begin values in screen and Z buffers
|
||||
movsx ebx,word[.x1]
|
||||
mov eax,ebx
|
||||
add esi,ebx
|
||||
lea ebx,[3*ebx]
|
||||
add esi,ebx
|
||||
add edi,ebx
|
||||
mov [.cscr],edi
|
||||
mov [.czbuf],esi
|
||||
|
||||
movzx ecx,word[.line_lenght]
|
||||
|
||||
movsx ebx,word[.r1]
|
||||
shl ebx,ROUND
|
||||
mov [.cr],ebx
|
||||
movsx ebx,word[.g1]
|
||||
shl ebx,ROUND
|
||||
mov [.cg],ebx
|
||||
movsx ebx,word[.b1]
|
||||
shl ebx,ROUND
|
||||
mov [.cb],ebx
|
||||
movsx ebx,word[.z1]
|
||||
shl ebx,ROUND
|
||||
mov [.cz],ebx
|
||||
if Ext >= SSE2
|
||||
movups xmm1,[.cz]
|
||||
end if
|
||||
movsx ebx,word[.y1]
|
||||
shl ebx,ROUND
|
||||
mov [.ccoord],ebx ; .ccoord -> y coordinate
|
||||
|
||||
.draw_m_h:
|
||||
mov edi,[.cscr]
|
||||
mov esi,[.czbuf]
|
||||
mov eax,[.ccoord] ; ccoord - cur y coordinate
|
||||
sar eax,ROUND
|
||||
mov ebx,[.xres] ;SIZE_X
|
||||
mul ebx
|
||||
add esi,eax
|
||||
lea eax,[eax*3]
|
||||
add esi,eax
|
||||
add edi,eax
|
||||
if Ext >= SSE2
|
||||
movd ebx,xmm1
|
||||
else
|
||||
mov ebx,[.cz]
|
||||
end if
|
||||
cmp [esi],ebx
|
||||
jle @f
|
||||
|
||||
.draw_pixel
|
||||
|
||||
@@:
|
||||
mov eax,[.delta]
|
||||
add [.ccoord],eax
|
||||
add dword[.cscr],3 ;
|
||||
add dword[.czbuf],4
|
||||
|
||||
.update_cur_var
|
||||
|
||||
dec ecx
|
||||
jnz .draw_m_h
|
||||
|
||||
.end_line:
|
||||
mov esp,ebp
|
||||
ret 24
|
||||
|
||||
.calc_delta:
|
||||
mov ax,[.z2]
|
||||
sub ax,[.z1]
|
||||
cwde
|
||||
shl eax,ROUND
|
||||
cdq
|
||||
idiv ebx
|
||||
mov [.dz],eax
|
||||
|
||||
mov ax,[.r2]
|
||||
sub ax,[.r1]
|
||||
cwde
|
||||
shl eax,ROUND
|
||||
cdq
|
||||
idiv ebx
|
||||
mov [.dr],eax
|
||||
|
||||
mov ax,[.g2]
|
||||
sub ax,[.g1]
|
||||
cwde
|
||||
shl eax,ROUND
|
||||
cdq
|
||||
idiv ebx
|
||||
mov [.dg],eax
|
||||
|
||||
mov ax,[.b2]
|
||||
sub ax,[.b1]
|
||||
cwde
|
||||
shl eax,ROUND
|
||||
cdq
|
||||
idiv ebx
|
||||
mov [.db],eax
|
||||
if Ext=MMX | Ext = SSE
|
||||
movq mm2,[.dz]
|
||||
movq mm3,[.dg]
|
||||
else if Ext >= SSE2
|
||||
movups xmm0,[.dz]
|
||||
movups xmm6,[.mask]
|
||||
end if
|
||||
ret
|
||||
.mask:
|
||||
dq 0xffffffff00ffffff
|
||||
dq 0xffffffffffffffff
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; Line drawing procedure by Pablo Reda.
|
||||
; Gouraud extension by Maciej Guba.
|
||||
;****************************************************
|
||||
line_grd: ; eax=x1 ebx=y1 ecx=x2 edx=y2
|
||||
; xmm0 - color1 argb as 4 dword float
|
||||
; xmm1 - color2 argb as 4 dword float
|
||||
; xmm2 - z1 as dword float
|
||||
; xmm3 - z2 as dword float
|
||||
; mm0 - Z buffer
|
||||
; mm1 - screen buffer
|
||||
; mm2 - screen width
|
||||
|
||||
|
||||
cmp ebx,edx
|
||||
; je horizontal_grd
|
||||
jg .noswap
|
||||
xchg eax,ecx
|
||||
xchg ebx,edx
|
||||
movaps xmm7,xmm0
|
||||
movaps xmm0,xmm1
|
||||
movaps xmm1,xmm7
|
||||
movaps xmm7,xmm2
|
||||
movaps xmm2,xmm3
|
||||
movaps xmm3,xmm7
|
||||
.noswap:
|
||||
|
||||
cvtsi2ss xmm7,eax
|
||||
cvtsi2ss xmm6,ebx
|
||||
cvtsi2ss xmm5,ecx
|
||||
cvtsi2ss xmm4,edx
|
||||
subss xmm7,xmm5
|
||||
subss xmm6,xmm4
|
||||
andps xmm7,[abs_mask] ; 0x7fff
|
||||
andps xmm6,[abs_mask] ; 0x7fff
|
||||
maxss xmm7,xmm6 ; xmm7 - delta
|
||||
shufps xmm7,xmm7,0
|
||||
movaps xmm6,xmm3
|
||||
rcpps xmm7,xmm7
|
||||
subss xmm6,xmm2
|
||||
mulss xmm6,xmm7 ; xmm6 - delta z
|
||||
movaps xmm5,xmm1
|
||||
subps xmm5,xmm0
|
||||
mulps xmm5,xmm7 ; xmm5 - delta col argb
|
||||
|
||||
|
||||
shl eax,16
|
||||
shl ecx,16
|
||||
sub eax,ecx
|
||||
push ebx
|
||||
push edx
|
||||
sub ebx,edx
|
||||
add ebx,1
|
||||
cdq
|
||||
idiv ebx
|
||||
mov esi,eax
|
||||
add ecx,$7fff
|
||||
pop ebx
|
||||
pop edx
|
||||
.lineas:
|
||||
mov eax,ecx
|
||||
add eax,esi
|
||||
push ebx
|
||||
push eax
|
||||
push edx
|
||||
shr ecx,16
|
||||
shr eax,16
|
||||
call horizontal_grd
|
||||
pop edx
|
||||
pop ecx
|
||||
pop ebx
|
||||
add ebx,1
|
||||
cmp ebx,edx
|
||||
jle .lineas
|
||||
ret
|
||||
|
||||
horizontal_grd: ; eax=x1 ebx=y1 ecx=x2
|
||||
cmp ecx,eax
|
||||
jg .m
|
||||
xchg ecx,eax
|
||||
.m:
|
||||
sub ecx,eax
|
||||
jnz .nn
|
||||
add ecx,1
|
||||
.nn:
|
||||
movd edx,mm2
|
||||
imul ebx,edx
|
||||
add eax,ebx
|
||||
movd edi,mm1
|
||||
lea edi,[edi+eax*4]
|
||||
push eax
|
||||
push ebx
|
||||
movd ebx,mm0
|
||||
lea ebx,[ebx+eax*4]
|
||||
.l:
|
||||
; movss xmm4,xmm2 ; xmm2 - cur z
|
||||
; cmpnltss xmm4,[ebx]
|
||||
; movd eax,xmm4
|
||||
; or eax,eax
|
||||
; jnz @f
|
||||
comiss xmm2,[ebx]
|
||||
jng @f
|
||||
movaps xmm4,xmm0 ; xmm0 - cur col
|
||||
cvtps2dq xmm4,xmm4
|
||||
packssdw xmm4,xmm4
|
||||
packuswb xmm4,xmm4
|
||||
movd [edi],xmm4
|
||||
@@:
|
||||
addss xmm2,xmm6
|
||||
addps xmm0,xmm5
|
||||
add edi,4
|
||||
sub ecx,1
|
||||
jnz .l
|
||||
pop ebx
|
||||
pop eax
|
||||
ret
|
||||
|
@ -1,4 +1,14 @@
|
||||
|
||||
View3ds 0.072 - march 2021
|
||||
1. New displaying model - texturing with bilinear filtering and transparency
|
||||
simultanusly. Note that filtering is done only inside polygon. To better
|
||||
quality of image there is a need to use floats coordinates of texture to pass
|
||||
as arguments to single triangle rendering proc.
|
||||
2. Optimizations.
|
||||
3. SSE3 version runs correct on SSE2 cpus, but real phong, glass and
|
||||
transparented texturing with filtering rendering models are disabled.
|
||||
-----------------------------------------------------------------------------------
|
||||
|
||||
View3ds 0.071 - VIII 2020
|
||||
1. New displaying model - glass - it's two pass rendering. First pass calculates
|
||||
Z position of all front pixels, second render image with adding reflective
|
||||
|
@ -1,7 +1,12 @@
|
||||
View3ds 0.072 - tiny viewer to .3ds and .asc files with several graphics
|
||||
View3ds 0.073 - tiny viewer to .3ds and .asc files with several graphics
|
||||
effects implementation.
|
||||
|
||||
What's new?
|
||||
1. I introduced procedure for searching nonredundand edges.
|
||||
2. Writing some info about object: vertices, triangles unique edges
|
||||
count.
|
||||
|
||||
|
||||
1. New displaying model - texturing with bilinear filtering and transparency
|
||||
simultanusly. Note that filtering is done only inside polygon. To better
|
||||
quality of image there is a need to use floats coordinates of texture to pass
|
||||
@ -26,21 +31,23 @@ Buttons description:
|
||||
8. rand. light: Randomize 3 unlinear lights( so called Phong's illumination).
|
||||
9. Blur: blur N times; N=0,1,2,3,4,5
|
||||
10.11,12,13. loseless operations (rotary 90, 180 degrees).
|
||||
12. emboss: Do emboss effect( flat bumps ), use 'bumps deep' button to do edges more deep.
|
||||
12. emboss: Do emboss effect( flat bumps ), use 'bumps deep' button to do edges
|
||||
more deep.
|
||||
13. fire: do motion blur ( looks like fire ).
|
||||
14. move: changes meaning x,y,z +/- buttons -> obj: moving object, camr: moving camera, wave: x,y +/- increase,
|
||||
decrease wave effect frequency and amplitude.
|
||||
14. move: changes meaning x,y,z +/- buttons -> obj: moving object, camr: moving
|
||||
camera, wave: x,y +/- increase, decrease wave effect frequency and amplitude.
|
||||
15. generate: Generates some objects: node, Thorn Crown, heart...
|
||||
16. bumps: random, according to texture.
|
||||
17. bumps deep -> create bumps deeper or lighter.
|
||||
18. re-map tex -> re-map texture and bump map coordinates, to change spherical mapping
|
||||
around axle use 'xchg' and 'mirror' buttons, then press 're-map tex' button.
|
||||
18. re-map tex -> re-map texture and bump map coordinates, to change spherical
|
||||
mapping around axle use 'xchg' and 'mirror' buttons, then press 're-map tex' button.
|
||||
19. bright + -> increase picture brightness.
|
||||
20. bright - -> decrease picture brightness.
|
||||
21. wav effect -> do effect based sine function.
|
||||
22. editor -> setting editing option. If is "on" then red bars are draw according to each vertex, Pressing
|
||||
and moving left mouse button (cursor must be on handler)- change vertex position. If left mouse button
|
||||
is released apply current position. You may also decrease whole handlers count by enable culling (using
|
||||
appropriate button) - some back handlers become hidden.
|
||||
22. editor -> setting editing option. If is "on" then red bars are draw according to each
|
||||
vertex, Pressing and moving left mouse button (cursor must be on handler)- change
|
||||
vertex position. If left mouse button is released apply current position. You may also
|
||||
decrease whole handlers count by enable culling (using appropriate button) - some
|
||||
back handlers become hidden.
|
||||
|
||||
Maciej Guba III 2021
|
||||
Maciej Guba V 2021
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user