source: GTP/trunk/App/Demos/Geom/Shark3D/clod_head_demo_win32/src/res/client/actor/gfx.s3d_actor @ 2236

Revision 2236, 26.0 KB checked in by gumbau, 17 years ago (diff)
Line 
1///////////////////////////////////////////////////////////////////////////////
2//
3//      ##  ######
4//       ######  ###
5//  ## ###############        Shark 3D Engine (www.shark3d.com)
6//   ########## # # #
7//    ########                Copyright (c) 1996-2006 Spinor GmbH.
8//   ######### # # #          All rights reserved.
9//  ##   ##########
10//      ##
11//
12///////////////////////////////////////////////////////////////////////////////
13
14// Definition of the graphics output.
15// This includes the graphics engine object and the gfxports.
16//
17// This file defines three gfxports.
18// a) Display gfxport.   Depth range 0.00 to 0.01.
19// b) World gfxport.     Depth range 0.01 to 0.99
20// c) Sky gfxport.       Depth range 0.99 to 1.00
21
22// The client root actor is a capsule, defining an own local namespace.
23actor_ident "kit_base.capsule"
24actor_param
25{
26    // Delegate the action calls to all children:
27    active 1
28    // Scope name for reporting errors:
29    scope "gfx"
30    // Name of the capsule actor within its own namespace.
31    // Actors within the capsule can access the capsule
32    // actor itself by this name.
33    local_name "capsule"
34    // Delegate events from outside:
35    deleg_target "dispatch_export"
36    // The capsule actor contains a group of actors:
37    child_ident "kit_base.group"
38    child_param
39    {
40        // Delegate action calls to the children.
41        active 1
42        child_array
43        {
44            // Dispatcher for commands from outside the capsule.
45            ident "kit_base.dispatch"
46            param
47            {
48                name "dispatch_export"
49                entry_array
50                {
51                    cmds "set_cursor_x" "set_cursor_y"
52                    targets "cursor"
53                }
54                {
55                    cmds "set_playerbody"
56                    targets "cursor"
57                    newcmd "set_avoid"
58                }
59                {
60                    cmds "set_gfxmgr_level"
61                    targets "gfxsect_level"
62                    newcmd "assign_gfxmgr"
63                }
64                {
65                    cmds "set_state_display"
66                    targets "gfxport_display"
67                    newcmd "assign_state"
68                }
69                {
70                    cmds "set_state_world"
71                    targets "gfxport_world"
72                    newcmd "assign_state"
73                }
74                {
75                    cmds "set_state_sky"
76                    targets "gfxport_sky"
77                    newcmd "assign_state"
78                }
79                {
80                    cmds "set_sim_world"
81                    targets "inspperform_sim_world"
82                    newcmd "set_obj"
83                }
84                {
85                    cmds "set_sim_world"
86                    targets "cursor"
87                    newcmd "set_sim"
88                }
89                {
90                    cmds "set_noise_world"
91                    targets "inspperform_noise_world"
92                    newcmd "set_obj"
93                }
94                {
95                    cmds "set_sensorstate_world"
96                    targets "inspperform_sensorstate_world"
97                    newcmd "set_obj"
98                }
99                {
100                    // Update camera transformation of world:
101                    cmds "set_camera_efftransf"
102                    targets "gfxport_world"
103                    newcmd "set_transf"
104                }
105                {
106                    // Click command:
107                    cmds "click"
108                        "set_cursor_x" "set_cursor_y"
109                        "move_cursor_x" "move_cursor_y"
110                    targets //"cursor"
111                }
112                {
113                    // Toggle frmtime information:
114                    cmds "toggle_frmtime"
115                    targets "inspfrmtime"
116                    newcmd "toggle_insp"
117                }
118                {
119                    // Toggle frmtime information:
120                    cmds "toggle_stat" "reset_stat"
121                    targets "inspfrmtime"
122                }
123                {
124                    cmds "reset_msg"
125                    targets "inspmsg"
126                    newcmd "reset"
127                }
128                {
129                    cmds "toggle_fullscreen"
130                    targets "gfxout"
131                }
132                {
133                    cmds "toggle_showgfxbound"
134                    targets
135                        "toggle_showgfxbound_sky"
136                        "toggle_showgfxbound_world"
137                        "toggle_showgfxbound_display"
138                    newcmd "perform"
139                }
140                {
141                    cmds "toggle_showgfxmesh"
142                    targets
143                        "toggle_showgfxmesh_sky"
144                        "toggle_showgfxmesh_world"
145                        "toggle_showgfxmesh_display"
146                    newcmd "perform"
147                }
148                {
149                    cmds "toggle_showgfxwire"
150                    targets
151                        "toggle_showgfxwire_sky"
152                        "toggle_showgfxwire_world"
153                        "toggle_showgfxwire_display"
154                    newcmd "perform"
155                }
156                {
157                    cmds "toggle_showgfxocclmesh"
158                    targets
159                        "toggle_showgfxocclmesh_sky"
160                        "toggle_showgfxocclmesh_world"
161                        "toggle_showgfxocclmesh_display"
162                    newcmd "perform"
163                }
164                {
165                    cmds "toggle_showgfxocclwire"
166                    targets
167                        "toggle_showgfxocclwire_sky"
168                        "toggle_showgfxocclwire_world"
169                        "toggle_showgfxocclwire_display"
170                    newcmd "perform"
171                }
172                {
173                    cmds "toggle_showphysbound"
174                    targets "toggle_showphysbound"
175                    newcmd "perform"
176                }
177                {
178                    cmds "toggle_showphysgeo"
179                    targets "toggle_showphysgeo"
180                    newcmd "perform"
181                }
182                {
183                    cmds "toggle_showphyscontact"
184                    targets "toggle_showphyscontact"
185                    newcmd "perform"
186                }
187                {
188                    cmds "toggle_shownoise"
189                    targets "toggle_shownoise"
190                    newcmd "perform"
191                }
192                {
193                    cmds "toggle_showsensorbound"
194                    targets "toggle_showsensorbound"
195                    newcmd "perform"
196                }
197                {
198                    cmds "toggle_showsensorgeo"
199                    targets "toggle_showsensorgeo"
200                    newcmd "perform"
201                }
202                {
203                    cmds "store_screenshot"
204                    targets "gfxeng"
205                }
206
207                // Paint sequence.
208                // The following entry_array define the steps in correct order
209                // which have to be performed for rendering a frame.
210                {
211                    cmds "paint"
212                    targets "cursor"
213                    newcmd "perform_raycast"
214                }
215                {
216                    cmds "paint"
217                    targets "gfxport_display"
218                    newcmd "perform"
219                }
220                {
221                    // Paint the general information.
222                    cmds "paint"
223                    targets "inspmem"
224                    newcmd "perform_insp"
225                }
226                {
227                    // Paint the general information.
228                    cmds "paint"
229                    targets "inspmsg"
230                    newcmd "perform_insp"
231                }
232                {
233                    // Paint the general information.
234                    cmds "paint"
235                    targets "inspgeneral"
236                    newcmd "perform_insp"
237                }
238                {
239                    // Finish the paint cycle.
240                    cmds "paint"
241                    targets "gfxeng"
242                    newcmd "perform_insp"
243                }
244                {
245                    // Finish the paint cycle.
246                    cmds "paint"
247                    targets "gfxout"
248                    newcmd "perform_insp"
249                }
250                {
251                    cmds "paint"
252                    targets "cursor"
253                    newcmd "perform_insp"
254                }
255                {
256                    // Update per-frame information of the gfx engine.
257                    cmds "paint"
258                    targets "inspperform_sim_world"
259                    newcmd "perform_insp"
260                }
261                {
262                    cmds "paint"
263                    targets "inspperform_noise_world"
264                    newcmd "perform_insp"
265                }
266                {
267                    // Update per-frame information of the gfx engine.
268                    cmds "paint"
269                    targets "inspperform_sensorstate_world"
270                    newcmd "perform_insp"
271                }
272                {
273                    // Paint the inspfrmtime last:
274                    cmds "paint"
275                    targets "inspfrmtime"
276                    newcmd "perform_insp"
277                }
278                {
279                    // Draw the per-frame information.
280                    cmds "paint"
281                    targets "insppaint"
282                    newcmd "paint"
283                }
284                {
285                    // Finish the paint cycle.
286                    cmds "paint"
287                    targets "gfxeng"
288                    newcmd "end_render"
289                }
290                {
291                    cmds "paint"
292                    targets "gfxout"
293                    newcmd "present"
294                }
295            }
296        }
297        {
298            // 3D graphics engine:
299            ident "kit_io.gfxeng"
300            param
301            {
302                name "gfxeng"
303                active 1
304                extcfg_actor "^^^cfg"
305                extcfg_entry_param "gfxeng"
306                extcfg_entry_insp_stat_enabled "insp.gfxstat"
307                inspcollect "^^inspcollect"
308                given_array
309                {
310                    item "^^^envcompsuppl"
311                    given_ident "envcompsuppl"
312                }
313                {
314                    item "^^^env"
315                    given_ident "env"
316                }
317            }
318        }
319        {
320            // 3D graphics engine:
321            ident "kit_io.gfxout"
322            param
323            {
324                ctx "^ctx"
325                gfxeng "gfxeng"
326                name "gfxout"
327                active 1
328                extcfg_actor "^^^cfg"
329                extcfg_entry_param "gfxout"
330                extcfg_entry_insp_base_enabled "insp.gfxbase"
331                inspcollect "^^inspcollect"
332            }
333        }
334        {
335            ident "kit_engbase.gfxctx"
336            param
337            {
338                name "gfxctx"
339                gfxeng "gfxeng"
340                extcfg_actor "^^^cfg"
341                extcfg_entry_featureset "feature_set"
342            }
343        }
344        {
345            // 3D graphics engine:
346            ident "kit_engbase.gfxsect"
347            param
348            {
349                name "gfxsect_display"
350                gfxctx "gfxctx"
351                gfxmgr_actor "^^display"
352                gfxmgr_cmd "get_display_gfxmgr"
353            }
354        }
355        {
356            // 3D graphics engine:
357            ident "kit_engbase.gfxsect"
358            param
359            {
360                name "gfxsect_level"
361                gfxctx "gfxctx"
362                gfxmgr_actor ""
363                gfxmgr_cmd ""
364            }
365        }
366        {
367            // Painting per-frame information lines.
368            ident "kit_engbase.insppaint"
369            param
370            {
371                name "insppaint"
372                inspcollect "^^inspcollect"
373                gfxctx "gfxctx"
374                tex_suppl "^^^basesuppl"
375                tex_ident "tex:client/texture/charset.tga"
376                extcfg_actor "^^^cfg"
377                extcfg_entry_chunk "insp.paint"
378            }
379        }
380
381        {
382            // Reporting general information.
383            ident "kit_base.inspmsg"
384            param
385            {
386                name "inspmsg"
387                inspcollect "^^inspcollect"
388                extcfg_actor "^^^cfg"
389                extcfg_entry_insp "insp.msg"
390                extcfg_entry_limit "insp.msg_limit"
391                extcfg_entry_alsoinfo "insp.msg_alsoinfo"
392            }
393        }
394        {
395            // Reporting general information.
396            ident "kit_base.inspgeneral"
397            param
398            {
399                name "inspgeneral"
400                inspcollect "^^inspcollect"
401                extcfg_actor "^^^cfg"
402                extcfg_entry_insp "insp.general"
403            }
404        }
405        {
406            // frmtime calculation actor.
407            ident "kit_base.inspfrmtime"
408            param
409            {
410                name "inspfrmtime"
411                inspcollect "^^inspcollect"
412                extcfg_actor "^^^cfg"
413                extcfg_entry_insp "insp.frmtime"
414                extcfg_entry_logfile "insp.frmtime_logfile"
415            }
416        }
417        {
418            //
419            ident "kit_base.inspmem"
420            param
421            {
422                name "inspmem"
423                inspcollect "^^inspcollect"
424                extcfg_actor "^^^cfg"
425                extcfg_entry_insp "insp.mem"
426            }
427        }
428        {
429            ident "kit_engbase.gfxport"
430            param
431            {
432                name "gfxport_sky"
433               
434                active 1
435               
436                gfxout "gfxout"
437                gfxctx "gfxctx"
438                next ""
439                couple 0
440               
441                state_actor ""
442                state_cmd ""
443               
444                gfxstat "gfxstat"
445               
446                extcfg_actor "^^^cfg"
447                extcfg_entry_proj "proj_world"
448                extcfg_entry_param "gfxport"
449                //extcfg_entry_eyedist "eyedist.display"
450
451                view_transl_x 0.00
452                view_transl_y 0.00
453                view_scale_x 1.00
454                view_scale_y 1.00
455                view_depth_start 0.99
456                view_depth_end 1.00
457
458                // Use orthogonal projection.
459                proj_ortho 0
460                // View frustum extension.
461                // These values are plane slopes in case of a persepctive
462                // projection, and coordinates otherwise.
463                // If all set to zero, read from cfguration file instead.
464                proj_open_x 0.0
465                proj_open_y 0.0
466                proj_center_x 0.0
467                proj_center_y 0.0
468                // Clipping plane coordinates.
469                proj_neg_z 0.05
470                proj_pos_z 1000.0
471                // Fog:
472                fog_color 0.5 0.5 0.5
473                //fog_density 0.02
474               
475                destprop_antialias 1
476                clear_must_coloralpha 1
477                clear_color 0.0 0.0 0.0
478
479                enum_trigger "main_trigger"
480            }
481        }
482        {
483            ident "kit_engbase.gfxport"
484            param
485            {
486                name "gfxport_world"
487               
488                active 1
489               
490                gfxout "gfxout"
491                gfxctx "gfxctx"
492                next "gfxport_sky"
493                couple 1   // Sky is coupled
494               
495                state_actor ""
496                state_cmd ""
497               
498                gfxstat "gfxstat"
499               
500                extcfg_actor "^^^cfg"
501                extcfg_entry_proj "proj_world"
502                extcfg_entry_param "gfxport"
503                //extcfg_entry_eyedist "eyedist.display"
504
505                view_transl_x 0.00
506                view_transl_y 0.00
507                view_scale_x 1.00
508                view_scale_y 1.00
509                view_depth_start 0.01
510                view_depth_end 0.99
511
512                // Use orthogonal projection.
513                proj_ortho 0
514                // View frustum extension.
515                // These values are plane slopes in case of a persepctive
516                // projection, and coordinates otherwise.
517                // If all set to zero, read from cfguration file instead.
518                proj_open_x 0.0
519                proj_open_y 0.0
520                proj_center_x 0.0
521                proj_center_y 0.0
522                // Clipping plane coordinates.
523                proj_neg_z 0.05
524                proj_pos_z 1000.0
525                // Fog:
526                fog_color 0.5 0.5 0.5
527                //fog_density 0.02
528
529                destprop_antialias 1
530                clear_must_coloralpha 1
531                clear_color 0.0 0.0 0.0
532
533                enum_trigger "main_trigger"
534            }
535        }
536        {
537            ident "kit_special.raycast"
538            param
539            {
540                name "raycast_cursor"
541            }
542        }
543        {
544            ident "kit_special.cursor"
545            param
546            {
547                name "cursor"
548                proj_src "gfxport_world"
549                proj_cmd "get_proj"
550                transf_src "gfxport_world"
551                transf_cmd "get_transf"
552                raycast_actor "raycast_cursor"
553                raycast_cmd "perform_raycast"
554                ray_start_z -1.0
555                ray_end_z 1.0
556
557                extcfg_actor "^^^cfg"
558                extcfg_entry_param "gfxeng"
559                extcfg_entry_insp_stat_enabled "insp.cursor"
560                inspcollect "^^inspcollect"
561            }
562        }
563        {
564            ident "kit_engbase.gfxport"
565            param
566            {
567                name "gfxport_display"
568               
569                active 1
570               
571                gfxout "gfxout"
572                gfxctx "gfxctx"
573                next "gfxport_world"
574                couple 0
575
576                state_actor "^^display"
577                state_cmd "get_display_state"
578               
579                gfxstat "gfxstat"
580               
581                extcfg_actor "^^^cfg"
582                extcfg_entry_proj "proj_display"
583                extcfg_entry_param "gfxport"
584                //extcfg_entry_eyedist "eyedist.display"
585
586                view_transl_x 0.00
587                view_transl_y 0.00
588                view_scale_x 1.00
589                view_scale_y 1.00
590                view_depth_start 0.00
591                view_depth_end 0.01
592
593                proj_ortho 1
594                proj_open_x 0.0
595                proj_open_y 0.0
596                proj_center_x 0.0
597                proj_center_y 0.0
598                proj_neg_z -1.0
599                proj_pos_z 1.0
600
601                fog_color 0.5 0.5 0.5
602                //fog_density 0.02
603
604                destprop_antialias 1
605                clear_must_coloralpha 1
606                clear_color 0.0 0.0 0.0
607
608                enum_trigger "main_trigger"
609            }
610        }
611        {
612            ident "kit_engbase.inspperform"
613            param
614            {
615                name "inspperform_sim_world"
616                inspcollect "^^inspcollect"
617                gfxport "gfxport_world"
618                obj ""
619            }
620        }
621        {
622            ident "kit_engbase.inspperform"
623            param
624            {
625                name "inspperform_noise_world"
626                inspcollect "^^inspcollect"
627                gfxport "gfxport_world"
628                obj ""
629            }
630        }
631        {
632            ident "kit_engbase.inspperform"
633            param
634            {
635                name "inspperform_sensorstate_world"
636                inspcollect "^^inspcollect"
637                gfxport "gfxport_world"
638                obj ""
639            }
640        }
641        {
642            ident "kit_base.paramstr"
643            param
644            {
645                name "toggle_showgfxbound_sky"
646                target "gfxport_sky"
647                cmd "toggle_mode_flag"
648                param "showbound"
649            }
650        }
651        {
652            ident "kit_base.paramstr"
653            param
654            {
655                name "toggle_showgfxbound_world"
656                target "gfxport_world"
657                cmd "toggle_mode_flag"
658                param "showbound"
659            }
660        }
661        {
662            ident "kit_base.paramstr"
663            param
664            {
665                name "toggle_showgfxbound_display"
666                target "gfxport_display"
667                cmd "toggle_mode_flag"
668                param "showbound"
669            }
670        }
671        {
672            ident "kit_base.paramstr"
673            param
674            {
675                name "toggle_showgfxmesh_sky"
676                target "gfxport_sky"
677                cmd "toggle_mode_flag"
678                param "showmesh"
679            }
680        }
681        {
682            ident "kit_base.paramstr"
683            param
684            {
685                name "toggle_showgfxmesh_world"
686                target "gfxport_world"
687                cmd "toggle_mode_flag"
688                param "showmesh"
689            }
690        }
691        {
692            ident "kit_base.paramstr"
693            param
694            {
695                name "toggle_showgfxmesh_display"
696                target "gfxport_display"
697                cmd "toggle_mode_flag"
698                param "showmesh"
699            }
700        }
701        {
702            ident "kit_base.paramstr"
703            param
704            {
705                name "toggle_showgfxwire_sky"
706                target "gfxport_sky"
707                cmd "toggle_mode_flag"
708                param "showwire"
709            }
710        }
711        {
712            ident "kit_base.paramstr"
713            param
714            {
715                name "toggle_showgfxwire_world"
716                target "gfxport_world"
717                cmd "toggle_mode_flag"
718                param "showwire"
719            }
720        }
721        {
722            ident "kit_base.paramstr"
723            param
724            {
725                name "toggle_showgfxwire_display"
726                target "gfxport_display"
727                cmd "toggle_mode_flag"
728                param "showwire"
729            }
730        }
731        {
732            ident "kit_base.paramstr"
733            param
734            {
735                name "toggle_showgfxocclmesh_sky"
736                target "gfxport_sky"
737                cmd "toggle_mode_flag"
738                param "showocclmesh"
739            }
740        }
741        {
742            ident "kit_base.paramstr"
743            param
744            {
745                name "toggle_showgfxocclmesh_world"
746                target "gfxport_world"
747                cmd "toggle_mode_flag"
748                param "showocclmesh"
749            }
750        }
751        {
752            ident "kit_base.paramstr"
753            param
754            {
755                name "toggle_showgfxocclmesh_display"
756                target "gfxport_display"
757                cmd "toggle_mode_flag"
758                param "showocclmesh"
759            }
760        }
761        {
762            ident "kit_base.paramstr"
763            param
764            {
765                name "toggle_showgfxocclwire_sky"
766                target "gfxport_sky"
767                cmd "toggle_mode_flag"
768                param "showocclwire"
769            }
770        }
771        {
772            ident "kit_base.paramstr"
773            param
774            {
775                name "toggle_showgfxocclwire_world"
776                target "gfxport_world"
777                cmd "toggle_mode_flag"
778                param "showocclwire"
779            }
780        }
781        {
782            ident "kit_base.paramstr"
783            param
784            {
785                name "toggle_showgfxocclwire_display"
786                target "gfxport_display"
787                cmd "toggle_mode_flag"
788                param "showocclwire"
789            }
790        }
791        {
792            ident "kit_base.paramstr"
793            param
794            {
795                name "toggle_showphysbound"
796                target "gfxport_world"
797                cmd "toggle_mode_flag"
798                param "showphysbound"
799            }
800        }
801        {
802            ident "kit_base.paramstr"
803            param
804            {
805                name "toggle_showphysgeo"
806                target "gfxport_world"
807                cmd "toggle_mode_flag"
808                param "showphysgeo"
809            }
810        }
811        {
812            ident "kit_base.paramstr"
813            param
814            {
815                name "toggle_showphyscontact"
816                target "gfxport_world"
817                cmd "toggle_mode_flag"
818                param "showphyscontact"
819            }
820        }
821        {
822            ident "kit_base.paramstr"
823            param
824            {
825                name "toggle_shownoise"
826                target "gfxport_world"
827                cmd "toggle_mode_flag"
828                param "shownoise"
829            }
830        }
831        {
832            ident "kit_base.paramstr"
833            param
834            {
835                name "toggle_showsensorbound"
836                target "gfxport_world"
837                cmd "toggle_mode_flag"
838                param "showsensorbound"
839            }
840        }
841        {
842            ident "kit_base.paramstr"
843            param
844            {
845                name "toggle_showsensorgeo"
846                target "gfxport_world"
847                cmd "toggle_mode_flag"
848                param "showsensorgeo"
849            }
850        }
851    }
852}
Note: See TracBrowser for help on using the repository browser.