New engine features

Top  Previous  Next

Stencil shadows improvements

 

Stencil shadows are now also visible in mirrored views with negative arc.

 

#include <acknex.h>

#include <default.c>

#include <mtlView.c>

 

STRING* test_wmb = "test.wmb";

 

VIEW* camera2_view =

{                

       layer = 10;

       pos_x = 10;

       pos_y = 10;

       tilt = -90;

       size_x = 400;

       size_y = 300;

       arc = -60;

       aspect = 1;

       ambient = 20;

       fog = 10;

       genius = NULL;

       flags = SHOW;

}

 

function main()

{

       camera.ambient = 70;

       fps_max = 70;

       video_mode = 8; // set the video resolution

       video_screen = 1; // start in full screen mode

       level_load (test_wmb);

       wait (2);

       ent_createlayer("skycube+6.tga", SKY | CUBE | SHOW, 1);       

       shadow_stencil = 2;

       shadow_lod = 2; // use the second LOD stage for stencil shadows

       stencil_blur(1); // activate blurred shadows

       camera2_view.z -= 150; // set the proper coords for the view, play with z, y, z, pan, tilt, roll

}

 

action shadow_model() // simple action that rotates this model in a circle

{

       set(my, SHADOW);

       while (1)

       {

               c_move (my, vector(5 * time_step, 0, 0), nullvector, IGNORE_PASSABLE | GLIDE);

               my.pan += 2 * time_step; // 2 sets the radius of the circle

               wait (1);

       }

}

 

aum112_beta

 

 

OVERLAY flag improvements

 

The OVERLAY flag for particles enforces writing into the z buffer for special purposes.