Rev 8047 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1979 | yogev_ezra | 1 | ; DATA AREA ************************************ |
2 | |||
8047 | leency | 3 | i3 dw 3 |
4 | i12 dd 12 |
||
5 | i256 dw 256 |
||
6 | i255d dd 255 |
||
7 | dot_max dd 1.0 ; dot product max and min |
||
8 | dot_min dd 0.0 |
||
9 | env_const dd 1.05 |
||
10 | correct_tex dw 255 |
||
11 | tex_x_div2 dw TEX_X / 2 |
||
12 | tex_y_div2 dw TEX_Y / 2 |
||
13 | xobs dw 0 ;SIZE_X / 2 ;200 ;observer = camera |
||
14 | yobs dw 0 ;SIZE_Y / 2 ;200 ;coordinates |
||
15 | zobs dw -1000 |
||
1979 | yogev_ezra | 16 | |
8047 | leency | 17 | re_alloc_flag db 0 |
18 | angle_counter dw 0 |
||
19 | piD180 dd 0.017453292519943295769236907684886 |
||
20 | piD128 dd 0.024544 |
||
21 | const6 dw 6,6,6,6 |
||
22 | x_offset dw SIZE_X / 2 |
||
23 | y_offset dw SIZE_Y / 2 |
||
24 | z_offset dw 0 |
||
25 | rsscale dd 175.0 ; next real scale |
||
26 | vect_x dw SIZE_X / 2 |
||
27 | vect_y dw SIZE_Y / 2 |
||
28 | vect_z dw 0 |
||
29 | angle_x dw 0 |
||
30 | angle_y dw 0 |
||
31 | angle_z dw 0 |
||
32 | sin_amplitude dd 50 |
||
33 | sin_frq dd 0.7 |
||
34 | sin_delta dd 0.07 ; wave frequency granularity |
||
35 | convert_muler: |
||
36 | dd 1, 10, 100, 1000, 10000 |
||
37 | XYZpartices: |
||
38 | db 'X','Y','Z' |
||
39 | i10 dw 10 |
||
40 | offset_y: |
||
41 | i25 dw 25 ; screen buff offset |
||
42 | offset_x: |
||
43 | i5 dw 5 |
||
44 | triangles_ptr dd 0 |
||
45 | triangles_w_z_ptr dd 0 |
||
46 | triangles_normals_ptr dd 0 |
||
47 | points_normals_ptr dd 0 |
||
48 | points_normals_rot_ptr dd 0 |
||
49 | points_ptr dd 0 |
||
50 | points_rotated_ptr dd 0 |
||
51 | points_translated_ptr dd 0 |
||
52 | screen_ptr dd 0 |
||
53 | Zbuffer_ptr dd 0 |
||
54 | vertices_index_ptr dd 0 |
||
1979 | yogev_ezra | 55 | |
6769 | IgorA | 56 | |
8047 | leency | 57 | vertex_edit_no dw 0 |
58 | edit_start_x: |
||
59 | dw 0 |
||
60 | edit_start_y dw 0 |
||
61 | edit_end_x: |
||
62 | dw 0 |
||
63 | edit_end_y dw 0 |
||
64 | mouse_state dd 0 |
||
1979 | yogev_ezra | 65 | |
8047 | leency | 66 | menu: |
67 | db 2 ; button number = index |
||
68 | db 'rotary ' ; label |
||
69 | db 3 ; max flag + 1 , if = 255, no flag |
||
70 | r_flag db 1 ; flag |
||
71 | dd axl_f ; offset to flags description |
||
72 | |||
73 | db 3 |
||
74 | db 'shd. model' |
||
75 | if Ext >= SSE3 |
||
8232 | leency | 76 | db 14 |
8047 | leency | 77 | else |
78 | db 12 |
||
79 | end if |
||
8014 | leency | 80 | dr_flag db 0 ; 6 - dots |
8047 | leency | 81 | dd shd_f |
1979 | yogev_ezra | 82 | |
8047 | leency | 83 | db 4 |
84 | db 'speed ' |
||
85 | db 2 |
||
1979 | yogev_ezra | 86 | speed_flag db 0 |
8047 | leency | 87 | dd spd_f |
1979 | yogev_ezra | 88 | |
8047 | leency | 89 | db 5 |
90 | db 'zoom out ' |
||
91 | db 255 |
||
92 | db ? |
||
93 | dd ? |
||
1979 | yogev_ezra | 94 | |
8047 | leency | 95 | db 6 |
96 | db 'zoom in ' |
||
97 | db 255 |
||
98 | db ? |
||
99 | dd ? |
||
1979 | yogev_ezra | 100 | |
8047 | leency | 101 | db 7 |
102 | db 'catmull ' |
||
103 | db 2 |
||
1979 | yogev_ezra | 104 | catmull_flag db 1 |
8047 | leency | 105 | dd onoff_f |
1979 | yogev_ezra | 106 | |
8047 | leency | 107 | db 8 |
108 | db 'culling ' |
||
109 | db 2 |
||
6619 | leency | 110 | culling_flag db 0 |
8047 | leency | 111 | dd onoff_f |
1979 | yogev_ezra | 112 | |
8047 | leency | 113 | db 9 |
114 | db 'rand.light' |
||
115 | db 255 |
||
116 | db ? |
||
117 | dd ? |
||
1979 | yogev_ezra | 118 | |
8047 | leency | 119 | db 10 |
120 | db 'blur ' |
||
121 | db 6 |
||
1979 | yogev_ezra | 122 | blur_flag db 0 |
8047 | leency | 123 | dd blur_f |
1979 | yogev_ezra | 124 | |
8047 | leency | 125 | db 11 |
126 | db 'mirror x ' |
||
127 | db 2 |
||
1979 | yogev_ezra | 128 | mirr_x_flag db 0 |
8047 | leency | 129 | dd onoff_f |
1979 | yogev_ezra | 130 | |
8047 | leency | 131 | db 12 |
132 | db 'mirror y ' |
||
133 | db 2 |
||
1979 | yogev_ezra | 134 | mirr_y_flag db 0 |
8047 | leency | 135 | dd onoff_f |
1979 | yogev_ezra | 136 | |
8047 | leency | 137 | db 13 |
138 | db 'mirror z ' |
||
139 | db 2 |
||
1979 | yogev_ezra | 140 | mirr_z_flag db 0 |
8047 | leency | 141 | dd onoff_f |
1979 | yogev_ezra | 142 | |
8047 | leency | 143 | db 14 |
144 | db 'xchg ' |
||
145 | db 4 |
||
1979 | yogev_ezra | 146 | xchg_flag db 0 |
8047 | leency | 147 | dd xchg_f |
1979 | yogev_ezra | 148 | |
8047 | leency | 149 | db 15 |
150 | db 'emboss ' |
||
151 | db 2 |
||
1979 | yogev_ezra | 152 | emboss_flag db 0 |
8047 | leency | 153 | dd onoff_f |
1979 | yogev_ezra | 154 | |
8047 | leency | 155 | db 16 |
156 | db 'fire ' |
||
157 | db 3 |
||
1979 | yogev_ezra | 158 | fire_flag db 0 |
8047 | leency | 159 | dd blur_f |
1979 | yogev_ezra | 160 | |
8047 | leency | 161 | db 17 |
162 | db 'move ' |
||
163 | db 3 |
||
1979 | yogev_ezra | 164 | move_flag db 0 |
8047 | leency | 165 | dd move_f |
1979 | yogev_ezra | 166 | |
8047 | leency | 167 | db 18 |
168 | db 'generate ' |
||
169 | db 6 |
||
170 | generator_flag db 0 |
||
171 | dd blur_f |
||
1979 | yogev_ezra | 172 | |
8047 | leency | 173 | db 19 |
174 | db 'bumps ' |
||
175 | db 2 |
||
176 | bumps_flag db 0 |
||
177 | dd bumps_f |
||
1979 | yogev_ezra | 178 | |
8047 | leency | 179 | db 20 |
180 | db 'bumps deep' |
||
181 | db 4 |
||
1979 | yogev_ezra | 182 | bumps_deep_flag db 3 |
8047 | leency | 183 | dd bumps_d_f |
1979 | yogev_ezra | 184 | |
8047 | leency | 185 | db 21 |
186 | db 're-map tex' |
||
187 | db 255 |
||
188 | map_tex_flag db ? ;1 |
||
189 | dd ? ;bumps_d_f |
||
2736 | leency | 190 | |
8047 | leency | 191 | db 22 |
192 | db 'bright + ' |
||
193 | db 6 |
||
2736 | leency | 194 | inc_bright_flag db 0 ;1 |
8047 | leency | 195 | dd blur_f |
2736 | leency | 196 | |
8047 | leency | 197 | db 23 |
198 | db 'bright - ' |
||
199 | db 6 |
||
2736 | leency | 200 | dec_bright_flag db 0 ;1 |
8047 | leency | 201 | dd blur_f |
2736 | leency | 202 | |
8047 | leency | 203 | db 24 |
204 | db 'wav effect' |
||
205 | db 2 |
||
206 | sinus_flag db 0 |
||
207 | dd onoff_f |
||
2984 | leency | 208 | |
6769 | IgorA | 209 | |
8047 | leency | 210 | db 25 |
211 | db 'editor ' |
||
212 | db 2 |
||
213 | edit_flag db 0 |
||
214 | dd onoff_f |
||
2736 | leency | 215 | ; db 24 |
216 | ; db 'max ' |
||
217 | ; db 2 |
||
218 | ;max_flag db 0 ;1 |
||
219 | ; dd blur_f |
||
220 | ; |
||
221 | ; db 25 |
||
222 | ; db 'min ' |
||
223 | ; db 2 |
||
224 | ;min_flag db 0 ;1 |
||
225 | ; dd blur_f |
||
226 | |||
227 | |||
228 | |||
1979 | yogev_ezra | 229 | ; db 21 |
230 | ; db 'light No. ' |
||
231 | ; db 3 |
||
232 | ;light_no_flag db 0 |
||
233 | ; dd bumps_d_f |
||
234 | |||
235 | ; db 22 |
||
236 | ; db 'light comp' |
||
237 | ; db 3 |
||
238 | ;light_comp_flag db 0 |
||
239 | ; dd light_component_f |
||
240 | |||
241 | ;; db 23 |
||
242 | ;; db 'col. comp' |
||
243 | ;; db 3 |
||
244 | ;;color_comp_flag db 0 |
||
245 | ;; dd color_component_f |
||
246 | |||
247 | |||
248 | |||
249 | |||
8047 | leency | 250 | |
251 | db -1 ; end mark |
||
252 | |||
253 | |||
254 | flags: ; flags description |
||
1979 | yogev_ezra | 255 | shd_f: |
256 | db 'flat' |
||
257 | db 'grd ' |
||
258 | db 'env ' |
||
259 | db 'bump' |
||
260 | db 'tex ' |
||
261 | db 'pos ' |
||
262 | db 'dots' |
||
263 | db 'txgr' |
||
264 | db '2tex' |
||
265 | db 'btex' |
||
266 | db 'cenv' |
||
2881 | leency | 267 | db 'grdl' |
8047 | leency | 268 | db 'rphg' |
8232 | leency | 269 | db 'glas' |
1979 | yogev_ezra | 270 | spd_f: |
271 | db 'idle' |
||
272 | db 'full' |
||
273 | axl_f: |
||
274 | db ' y ' |
||
275 | db 'x+y ' |
||
276 | db ' x ' |
||
277 | onoff_f: |
||
278 | db 'off ' |
||
279 | db 'on ' |
||
280 | |||
8047 | leency | 281 | blur_f: ; blur, fire |
282 | db 'off ' |
||
1979 | yogev_ezra | 283 | bumps_d_f: db ' 1 ' |
8047 | leency | 284 | db ' 2 ' |
285 | db ' 3 ' |
||
286 | db ' 4 ' |
||
287 | db ' 5 ' |
||
1979 | yogev_ezra | 288 | |
289 | xchg_f: |
||
290 | db 'no ' |
||
291 | db 'x<>y' |
||
292 | db 'z<>x' |
||
293 | db 'y<>z' |
||
294 | move_f: |
||
295 | db 'obj ' |
||
296 | db 'camr' |
||
2984 | leency | 297 | db 'wave' |
1979 | yogev_ezra | 298 | ; db 'lght' |
299 | bumps_f: |
||
300 | db 'rand' |
||
301 | db 'tex ' |
||
302 | ; db 'cscl' |
||
303 | base_vector: |
||
304 | labelvector: |
||
8047 | leency | 305 | db 'add vector' |
1979 | yogev_ezra | 306 | labelvectorend: |
307 | labelyminus: |
||
8047 | leency | 308 | db 'y -' |
1979 | yogev_ezra | 309 | labelyminusend: |
310 | labelzplus: |
||
8047 | leency | 311 | db 'z +' |
1979 | yogev_ezra | 312 | labelzplusend: |
313 | labelxminus: |
||
8047 | leency | 314 | db 'x -' |
1979 | yogev_ezra | 315 | labelxminusend: |
316 | labelxplus: |
||
8047 | leency | 317 | db 'x +' |
1979 | yogev_ezra | 318 | labelxplusend: |
319 | labelzminus: |
||
8047 | leency | 320 | db 'z -' |
1979 | yogev_ezra | 321 | labelzminusend: |
322 | labelyplus: |
||
8047 | leency | 323 | db 'y +' |
1979 | yogev_ezra | 324 | labelyplusend: |
325 | |||
326 | |||
327 | labelt: |
||
8047 | leency | 328 | db 'DEUS CARITAS EST' |
1979 | yogev_ezra | 329 | if Ext=MMX |
8047 | leency | 330 | db ' (MMX)' |
1979 | yogev_ezra | 331 | end if |
332 | if Ext=SSE |
||
8047 | leency | 333 | db ' (SSE)' |
1979 | yogev_ezra | 334 | end if |
335 | if Ext=SSE2 |
||
8047 | leency | 336 | db ' (SSE2)' |
1979 | yogev_ezra | 337 | end if |
8047 | leency | 338 | if Ext=SSE3 |
339 | db ' (SSE3)' |
||
340 | end if |
||
8232 | leency | 341 | db ' 0.071',0 |
1979 | yogev_ezra | 342 | labellen: |
8047 | leency | 343 | STRdata db '-1 ' |
1979 | yogev_ezra | 344 | |
345 | all_lights_size dw lightsend-lights |
||
346 | |||
347 | |||
8047 | leency | 348 | file_info: |
349 | dd 0 |
||
350 | dd 0 |
||
351 | dd 0 |
||
352 | fsize dd 0 ;180000 ; sizeof(workarea) |
||
353 | fptr dd 0 ;workarea |
||
354 | file_name: |
||
355 | db '/rd/1/3d/house.3ds',0 |
||
8232 | leency | 356 | ; db '/tmp0/1/ant.3ds',0 |
1979 | yogev_ezra | 357 | |
358 | rb 256 |
||
359 | |||
360 | ;============================================= |
||
361 | lights: |
||
8047 | leency | 362 | .light_vector dd 0.0,0.0,-1.0 ; x,y,z Z cooficient of vector must be negative |
363 | .orginal_color_r db 1 ; +12 |
||
364 | .orginal_color_g db 255 ; |
||
365 | .orginal_color_b db 1 ; +14 |
||
366 | .min_color_r db 1 ; |
||
367 | .min_color_g db 1 ; +16 |
||
368 | .min_color_b db 1 ; |
||
369 | .max_color_r db 255 ; |
||
370 | .max_color_g db 255 ; |
||
371 | .max_color_b db 255 ; |
||
372 | .shine db 24 ; +21 |
||
1979 | yogev_ezra | 373 | ; LIGHT_SIZE equ ($-lights) |
374 | |||
8047 | leency | 375 | dd -0.5,-0.5,-1.0 ; x,y,z ; .light_vector |
376 | db 5 ; .orginal_color_r |
||
377 | db 1 ; .orginal_color_g |
||
378 | db 135 ; .orginal_color_b |
||
379 | db 19 ; .min_color_r |
||
380 | db 19 ; .min_color_g |
||
381 | db 19 ; .min_color_b |
||
382 | db 255 ; .max_color_r |
||
383 | db 255 ; .max_color_g |
||
384 | db 255 ; .max_color_b |
||
385 | db 16 ; .shine |
||
1979 | yogev_ezra | 386 | |
8047 | leency | 387 | dd 0.5,0.5,-1.0 ; x,y,z ; .light_vector |
388 | db 135 ; .orginal_color_r |
||
389 | db 1 ; .orginal_color_g |
||
390 | db 1 ; .orginal_color_b |
||
391 | db 19 ; .min_color_r |
||
392 | db 19 ; .min_color_g |
||
393 | db 19 ; .min_color_b |
||
394 | db 255 ; .max_color_r |
||
395 | db 255 ; .max_color_g |
||
396 | db 20 ; .max_color_b |
||
397 | db 16 ; .shine |
||
1979 | yogev_ezra | 398 | ; ALL_LIGHTS_SIZE equ ($ - lights) |
399 | ;#all_lights_size dw ($ - lights) ;ALL_LIGHTS_SIZE |
||
400 | ;=============================================== |
||
401 | |||
402 | lightsend: |
||
8047 | leency | 403 | |
404 | |||
405 | |||
406 | |||
6769 | IgorA | 407 | align 16 |
408 | emboss_bias: |
||
8047 | leency | 409 | dw 128, 128, 128, 128, 128, 128, 128, 128 |
410 | zero_hgst_dd: |
||
411 | dd -1, -1, -1, 0 |
||
412 | mask_255f: |
||
413 | times 4 dd 255.0 |
||
414 | the_zero: |
||
415 | times 4 dd 0.0 |
||
1979 | yogev_ezra | 416 | |
6769 | IgorA | 417 | I_END: |
1979 | yogev_ezra | 418 | SourceFile: |
419 | workarea rb 180 |
||
420 | EndFile dd ? |
||
421 | align 8 |
||
8047 | leency | 422 | sinbeta dd ?;+32 |
423 | cosbeta dd ? |
||
1979 | yogev_ezra | 424 | |
8047 | leency | 425 | xsub dw ? |
426 | zsub dw ?;+40 |
||
427 | ysub dw ? |
||
1979 | yogev_ezra | 428 | |
8047 | leency | 429 | xx1 dw ? |
430 | yy1 dw ? |
||
431 | zz1 dw ?;+48 xx1 + 4 |
||
432 | xx2 dw ? |
||
433 | yy2 dw ? |
||
434 | zz2 dw ? ; xx1 + 10 |
||
435 | xx3 dw ?;+56 |
||
436 | yy3 dw ? |
||
437 | zz3 dw ? ; xx1 + 16 |
||
438 | col1 dd ? |
||
439 | col2 dd ? |
||
440 | col3 dd ? |
||
441 | scale dd ? ; help scale variable |
||
8232 | leency | 442 | |
1979 | yogev_ezra | 443 | ;== |
8047 | leency | 444 | triangles_count_var dd ? |
445 | points_count_var dd ? |
||
8232 | leency | 446 | |
8047 | leency | 447 | size_y_var: |
8232 | leency | 448 | yres_var dw ? |
449 | |||
8047 | leency | 450 | size_x_var: |
8232 | leency | 451 | xres_var dw ? |
8047 | leency | 452 | x_start: |
453 | dw ? |
||
454 | y_start: |
||
455 | dw ? |
||
1979 | yogev_ezra | 456 | |
457 | ;=== |
||
458 | |||
8047 | leency | 459 | point_index1 dd ? ;-\ |
460 | point_index2 dd ? ; } don't change order |
||
461 | point_index3 dd ? ;-/ |
||
462 | temp_col dw ? |
||
8232 | leency | 463 | temp1 dd ? |
464 | temp2 dd ? |
||
8047 | leency | 465 | high dd ? |
466 | rand_seed dw ? |
||
1979 | yogev_ezra | 467 | align 8 |
8047 | leency | 468 | buffer dq ? |
469 | errr dd ? |
||
470 | drr dd ? |
||
471 | xx dd ? |
||
472 | yy dd ? |
||
473 | xst dd ? |
||
474 | yst dd ? |
||
1979 | yogev_ezra | 475 | ; screen_ptr dd ? |
476 | ; Zbuffer_ptr dd ? |
||
477 | |||
8047 | leency | 478 | matrix rb 36 |
479 | cos_tab rd 360 |
||
480 | sin_tab rd 360 |
||
1979 | yogev_ezra | 481 | |
482 | align 16 |
||
483 | |||
484 | |||
485 | points_count = 180000/6*3 |
||
486 | triangles_count = 180000 / 6 ;($-triangles)/6 |
||
487 | align 16 |
||
8047 | leency | 488 | label trizdd dword |
489 | label trizdq qword |
||
490 | triangles_with_z rw triangles_count*4 + 2 ; triangles triple dw + z position |
||
1979 | yogev_ezra | 491 | align 16 |
8047 | leency | 492 | vectors rb 24 |
1979 | yogev_ezra | 493 | align 16 |
8047 | leency | 494 | bumpmap rb TEXTURE_SIZE + 1 |
1979 | yogev_ezra | 495 | align 16 |
8047 | leency | 496 | bumpmap2 rb TEXTURE_SIZE + 1 |
1979 | yogev_ezra | 497 | align 16 |
8047 | leency | 498 | envmap rb (TEXTURE_SIZE +1) * 3 |
1979 | yogev_ezra | 499 | align 16 |
8047 | leency | 500 | envmap_cub rb TEX_X * 3 |
1979 | yogev_ezra | 501 | align 16 |
8047 | leency | 502 | texmap rb (TEXTURE_SIZE +1) * 3 |
1979 | yogev_ezra | 503 | align 16 |
8232 | leency | 504 | color_map rb (TEXTURE_SIZE +100) * 3 |
1979 | yogev_ezra | 505 | align 16 |
8047 | leency | 506 | tex_points rb points_count * 4 ; bump_map and texture coords |
507 | ; each point word x, word y |
||
1979 | yogev_ezra | 508 | align 16 |
8047 | leency | 509 | lights_aligned: |
510 | lights_aligned_end = $ + 16 * 12 |
||
511 | rb 16 * 12 |
||
512 | |||
513 | |||
2881 | leency | 514 | if Ext >= SSE2 |
8047 | leency | 515 | sse_repository rb 1024 |
2881 | leency | 516 | end if |
1979 | yogev_ezra | 517 | ; SourceFile: ; source file temporally in screen area |
518 | ; workarea dd ? |
||
519 | |||
520 | ; screen rb SIZE_X * SIZE_Y * 3 ; screen buffer |
||
521 | ;align 16 |
||
522 | ; Z_buffer rb SIZE_X * SIZE_Y * 4 |
||
8047 | leency | 523 | procinfo: |
524 | rb 1024 ; process info |
||
525 | I_Param rb 256 |
||
526 | memStack: |
||
527 | rb 2000 |
||
1979 | yogev_ezra | 528 | align 16 |
6769 | IgorA | 529 | screen:>>> |