Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS Effect - Constants.h
    »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
    »Version«   4.51 / »GUID« A9981407-3EC9-42AF-8B6F-8BE6DD919615                                                                                                        */
/*   -------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/*  Copyright: © 2002-2017, Andrew Aye.  All Rights Reserved.
    This software is free for non-commercial use.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
      following conditions are met:
        Redistribution of source code must retain this copyright notice, this list of conditions and the following disclaimers.
        Redistribution in binary form must reproduce this copyright notice, this list of conditions and the following disclaimers in the documentation and other materials
          provided with the distribution.
    The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
    The intellectual property rights of the algorithms used reside with Andrew Aye.
    You may not use this software, in whole or in part, in support of any commercial product without the express written consent of the author.
    There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
#if !defined(TGS_EFFECT_CONSTANTS_H)
#define TGS_EFFECT_CONSTANTS_H
#pragma once

#if !defined(TGS_EFFECT_H)
#error This file should not be included directly - use the correct platform include wrapper
#endif


/* == Effect ============================================================================================================================================================ */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Public Constants                                                                                                                                                      */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

/* ---- Effects --------------------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_ENUM( ETgFX_ANIM_DATA, TgSINT32,

    ETgFX_ANIM_DATA__INVALID,
    ETgFX_ANIM_DATA__CONSTANT_F4,
    ETgFX_ANIM_DATA__KEY_FRAME_F1,
    ETgFX_ANIM_DATA__KEY_FRAME_F2,
    ETgFX_ANIM_DATA__KEY_FRAME_F3,
    ETgFX_ANIM_DATA__KEY_FRAME_F4,
    ETgFX_ANIM_DATA__SIN,
    ETgFX_ANIM_DATA__SQUARE,
    ETgFX_ANIM_DATA__SPLINE,
    ETgFX_ANIM_DATA__FLICKER,
    ETgFX_ANIM_DATA__MAX,
);

TgTYPE_ENUM( ETgFX__EFFECT, TgSINT32,

    ETgFX__INVALID,

    /* No Rendering (Client / Update) */
    ETgFX__GROUP,
    ETgFX__LIGHT,
    ETgFX__SOUND,

    /* Render Effects (Client / Update / Render) */
    ETgFX__BEAM,
    ETgFX__BILLBOARD,
    ETgFX__DECAL,
    ETgFX__EMITTER,
    ETgFX__POST,
    ETgFX__TRAIL,

    /* Effect Systems (Client / Update / System / Render) */
    ETgFX__GIB, /*« GIBs - Independent simulating geometry chunks */
    ETgFX__GLASS, /*« Glass - Fracture simulation and render */
    ETgFX__LIQUID, /*« Liquid Pools (Blood, Oil, Acid ... ) */

    ETgFX__EFFECT_MAX,
);


/* ---- Configuration --------------------------------------------------------------------------------------------------------------------------------------------------- */

/* Effects that execute on the client thread */
enum { KTgFX_MAX_LIGHT                      =   128 };
enum { KTgFX_MAX_SOUND                      =   128 };
enum { KTgFX_MAX_GROUP                      =  1024 };

/* Effects that execute on the render thread */
enum { KTgFX_MAX_BEAM                       =   128 };
enum { KTgFX_MAX_BILLBOARD                  =   128 };
enum { KTgFX_MAX_DECAL                      =   128 };
enum { KTgFX_MAX_EMITTER                    =   128 };
enum { KTgFX_MAX_POST                       =   128 };
enum { KTgFX_MAX_TRAIL                      =   128 };

enum { KTgFX_MAX_GIB                        =   128 };
enum { KTgFX_MAX_GLASS                      =    32 };
enum { KTgFX_MAX_LIQUID                     =   128 };

/* Maximum number of effects that can be rendered in one frame. */
enum { KTgFX_MAX_RENDER_INSTANCE            = KTgFX_MAX_BEAM
                                            + KTgFX_MAX_BILLBOARD
                                            + KTgFX_MAX_DECAL
                                            + KTgFX_MAX_EMITTER
                                            + KTgFX_MAX_POST
                                            + KTgFX_MAX_TRAIL
                                            + KTgFX_MAX_GIB
                                            + KTgFX_MAX_GLASS
                                            + KTgFX_MAX_LIQUID
};

/* Maximum number of effect instances supported by the system */
enum { KTgFX_MAX_EFFECT_INSTANCE            = KTgFX_MAX_RENDER_INSTANCE
                                            + KTgFX_MAX_LIGHT
                                            + KTgFX_MAX_SOUND
                                            + KTgFX_MAX_GROUP
};

/* Number of sub-effects supported by a group */
enum { KTgFX_MAX_GROUP_SUB_EFFECTS          =     8 };
enum { KTgFX_MAX_PARTICLE_FOR_EMITTER       =  8192 };
enum { KTgFX_MAX_POINTS_IN_TRAIL            =   128 };


/* ---- Effect Descriptors ---------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_ENUM( ETgFX_BILLBOARD_ORIENTATION, TgSINT32,

    ETgFX_BILLBOARD_ORIENTATION__CAMERA_FACE_SPHERE,
    ETgFX_BILLBOARD_ORIENTATION__CAMERA_FACE_PLANE,
    ETgFX_BILLBOARD_ORIENTATION__CAMERA_FACE_SPHERE__FIXED_Y,
    ETgFX_BILLBOARD_ORIENTATION__CAMERA_FACE_PLANE__FIXED_Y,
    ETgFX_BILLBOARD_ORIENTATION__NONE
);

TgTYPE_ENUM( ETgFX_BILLBOARD_FLAGS, TgSINT32,

    ETgFX_BILLBOARD_FLAGS__HAS_FADE_ANGLE = 1 << 0,
);

TgTYPE_ENUM( ETgFX_EMISSION_SHAPE, TgSINT32,
/*  Emission Shape Type                        Emission Shape Vector */
    ETgFX_EMISSION_SHAPE__POINT,           /*« [-,-,-,-] Unused */
    ETgFX_EMISSION_SHAPE__SPHERE,          /*« [r,r,r,r] Radius */
    ETgFX_EMISSION_SHAPE__BOX,             /*« [x,y,z,-] X/Y/Z Extents from Emitter centre */
    ETgFX_EMISSION_SHAPE__DISK,            /*« [r,r,r,r] Radius, Standard Basis Vectors in Model Space */
    ETgFX_EMISSION_SHAPE__CIRCLE,          /*« [r,r,r,r] Radius, Standard Basis Vectors in Model Space */
    ETgFX_EMISSION_SHAPE__VELOCITY,        /*« [d,d,d,d] Distance to spawn in direction of velocity */
);

TgTYPE_ENUM( ETgFX_EMISSION_FLAGS, TgSINT32,

    ETgFX_EMITTER_FLAGS__EMISSION__POSITION_CURRENT_RELATIVE = 1 << 0,       /*« Relative to the Emitter */
    ETgFX_EMITTER_FLAGS__EMISSION__ROTATION_CURRENT_RELATIVE = 1 << 1,       /*« Relative to the Emitter */
    ETgFX_EMITTER_FLAGS__EMISSION__ROTATION_START_RELATIVE = 1 << 2,         /*« Relative to the Emitter */
    ETgFX_EMITTER_FLAGS__EMISSION__EMITTER_ATTRACTOR = 1 << 3,               /*« Emitter exerts a force on the particles */
    ETgFX_EMITTER_FLAGS__EMISSION__MESH_SET = 1 << 4,                        /*« Emitter uses mesh sets instead of particles / quads */
    ETgFX_EMITTER_FLAGS__EMISSION__PARTICLE_COLLIDE_STATIC_CACHED = 1 << 5,  /*« Particles collide against a triangle cache from static geometry */
    ETgFX_EMITTER_FLAGS__EMISSION__PARTICLE_COLLIDE_STATIC = 1 << 6,         /*« Particles collide against static geometry */
    ETgFX_EMITTER_FLAGS__EMISSION__PARTICLE_COLLIDE_FULL = 1 << 7,           /*« Particles collide against the entire world scene */

    ETgFX_EMITTER_FLAGS__PARTICLE_REFERENCE_FRAME_RECALC = 1 << 8,           /*« Reference Frame is calculated per particle instead of per emitter */

    ETgFX_EMITTER_FLAGS__EMISSION__PARTICLE_COLLIDE_MASK = 1 << 5 | 1 << 6 | 1 << 7,
);

TgTYPE_ENUM( ETgFX_PARTICLE_ORIENTATION, TgSINT32,

    ETgFX_PARTICLE_ORIENTATION__CAMERA_FACE_SPHERE,
    ETgFX_PARTICLE_ORIENTATION__CAMERA_FACE_PLANE,
    ETgFX_PARTICLE_ORIENTATION__CAMERA_FACE_SPHERE__FIXED_Y,
    ETgFX_PARTICLE_ORIENTATION__CAMERA_FACE_PLANE__FIXED_Y,
    ETgFX_PARTICLE_ORIENTATION__CAMERA_FACE_SPHERE__FIXED_XZ,
    ETgFX_PARTICLE_ORIENTATION__CAMERA_FACE_PLANE__FIXED_XZ,
    ETgFX_PARTICLE_ORIENTATION__VELOCITY_TANGENT,
    ETgFX_PARTICLE_ORIENTATION__SCREEN_SPACE,
    ETgFX_PARTICLE_ORIENTATION__NONE,
);

TgTYPE_ENUM( ETgFX_TRAIL_TYPE, TgSINT32,

    ETgFX_TRAIL_TYPE__TEX_PER_POINT,
    ETgFX_TRAIL_TYPE__TEX_PER_METER,
    ETgFX_TRAIL_TYPE__TEX_FIXED,
);


/* ====================================================================================================================================================================== */
#endif