Example #1
0
 static void R_ViewStatistics(ViewDef parms)
 {
     // report statistics about this view
     if (!r_showSurfaces.Bool)
     {
         return;
     }
     common.Printf($"view:{parms} surfs:{parms.numDrawSurfs}\n");
 }
Example #2
0
        // This is the main 3D rendering command.  A single scene may have multiple views if a mirror, portal, or dynamic texture is present.
        static void R_AddDrawViewCmd(ViewDef parms)
        {
            var cmd = R_GetCommandBuffer <DrawSurfsCommand>();

            cmd.commandId = RC.DRAW_VIEW;
            cmd.viewDef   = parms;
            // save the command for r_lockSurfaces debugging
            if (parms.viewEntitys != null)
            {
                tr.lockSurfacesCmd = cmd;
            }
            tr.pc.c_numViews++;
            R_ViewStatistics(parms);
        }
Example #3
0
        //=================================================================================



        // r_lockSurfaces allows a developer to move around without changing the composition of the scene, including
        // culling.  The only thing that is modified is the view position and axis, no front end work is done at all
        //
        // Add the stored off command again, so the new rendering will use EXACTLY the same surfaces, including all the culling, even though the transformation
        // matricies have been changed.  This allow the culling tightness to be evaluated interactively.
        static void R_LockSurfaceScene(ViewDef parms)
        {
            DrawSurfsCommand cmd; ViewEntity vModel;

            // set the matrix for world space to eye space
            R_SetViewMatrix(parms);

            tr.lockSurfacesCmd.viewDef.worldSpace = parms.worldSpace;

            // update the view origin and axis, and all the entity matricies
            for (vModel = tr.lockSurfacesCmd.viewDef.viewEntitys; vModel != null; vModel = vModel.next)
                fixed(float *a = vModel.modelMatrix)
                {
                    fixed(float *b = tr.lockSurfacesCmd.viewDef.worldSpace.u.eyeViewMatrix0, c = vModel.u.eyeViewMatrix0) myGlMultMatrix(a, b, c);

                    fixed(float *b = tr.lockSurfacesCmd.viewDef.worldSpace.u.eyeViewMatrix1, c = vModel.u.eyeViewMatrix1) myGlMultMatrix(a, b, c);

                    fixed(float *b = tr.lockSurfacesCmd.viewDef.worldSpace.u.eyeViewMatrix2, c = vModel.u.eyeViewMatrix2) myGlMultMatrix(a, b, c);
                }

            // add the stored off surface commands again
            cmd = R_GetCommandBuffer <DrawSurfsCommand>();
            cmd.Set(tr.lockSurfacesCmd);
        }
Example #4
0
 public ViewDef(ViewDef s)
 {
 }
Example #5
0
 public virtual IRenderModel InstantiateDynamicModel(RenderEntity ent, ViewDef view, IRenderModel cachedModel);