Graphics.AddingReflection - lordmundi/wikidoctest GitHub Wiki

Adding Reflection

« Adding a camera with a fixed field of view | EDGE User’s Guide | Configure Stars »

Intro

This document describes how to add reflection to a model. Be careful - mirror reflections are not very common and are not to be confused with Environment Reflections.

Limitations

The model itself must be capable of reflection. ac3d does not support reflection.

Example

% cd $DOUG_HOME
 % tar xvfz [datareflection.tgz][6]
 % mv userdata userdata.bk
 % ln -s datareflection userdata
 % mkdir textures
 % cp userdata/mars.rgb textures
 % ./run_graphics

Setup Reflection In Config File

  • Commandline Options

    Add the following to the DSP_CONFIG.DOUG.command_line block: -reflections -reflection_grp 0xFFFFFFFF ;

       The hex number is a mask that enables/disables groups
       0xFFFFFFFF enables all groups
    
  • Stencil Buffering

    Add the following to the DSP_CONFIG.DISPLAY.*.visual block STENCIL 8

       Example Block With Stenciling:
              DISPLAY
              {         
                 DEFAULT
                 { 
                      visual
                      {
                           RGBA        1 1 1 0
                           STENCIL     8
                           DEPTH       1
                           SAMPLES     −1
                           DITHER      OFF
                      }
                 }
               }
    
  • Reflection Group

    Add a DSP_CONFIG.DATA.SCENE_LOAD.GROUP.REFLECTIONS block with the following elements: group(); catcher(); caster(); source(<model that casts reflection onto "caster">);

       Multiple casters and sources can be specified in the group
       Multiple groups can be specified and enabled/disabled
       with the -reflection_grp mask
    
       Example Group:
    
             # CEV reflection configuration:
             GROUPS
             {
                   REFLECTIONS
                   {
                      group(1);
                      catcher(CEV_CDR_Eyepoint);
                      catcher(CEV_CDR_Eyepoint2);
                      caster(CEV_MIRROR_SURFACE);
                      source(CEV_COMMAND_MODULE);
                      source(CEV_CM_shell);
                      source(CEV_CM_SEATS);
                      source(CEV_CM_WIN1);
                      source(CEV_CM_WIN2);
                      source(CEV_CM_WIN3);
                      source(CEV_CM_WIN4);
                      source(CEV_CM_WIN5);
                      source(CEV_CM_SIDE_WIN1);
                      source(CEV_CM_SIDE_WIN2);
                      source(CEV_CM_SIDE_WIN3);
                      source(LAS);
                      source(CEV_crew_right);
                      source(CEV_crew_right_helmet);
                      source(CEV_crew_left);
                   }
              } 
    

« Adding a camera with a fixed field of view | EDGE User’s Guide | Configure Stars »