Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS Effect - Beam - Render.c
    »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".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */

#include "TgS Effect - Render.inl"

#define T_NAME( A, ... ) A##Beam##__VA_ARGS__
#define T_TYPE( A, ... ) A##BEAM##__VA_ARGS__
#define T_TEXT( ... ) __VA_ARGS__ TgT("Beam")

#include "TgS Effect - Effect - Type.h_inc"


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

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Shared Implementation                                                                                                                                                 */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

#include "TgS Effect - Effect - Render.c_inc"




/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  File Local Types                                                                                                                                                      */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

TgTYPE_STRUCT(STg2_FX__Beam__Render_Point,)
{
    /* --------------- Input --------------- */
    CP_STg2_FX__Beam                            m_psBeam;
    CP_STg2_FX_Beam__File_Data                  m_psFile_Data;
    TgFLOAT32                                   m_fStart_Completion;
    TgFLOAT32                                   m_fEnd_Completion;
    TgUINT32                                    m_uiPad0[2];
    TgVEC_M_F32_04                              m_vBeam_SG_M;
    TgVEC_M_F32_04                              m_vCam_Forward;

    /* --------------- Output -------------- */
    TgVEC_M_F32_04                              m_vS0_W;
    TgVEC_M_F32_04                              m_vS1_W;
    TgVEC_M_F32_04                              m_vSN_W;
    TgVEC_M_F32_04                              m_vN0_W;
    TgVEC_M_F32_04                              m_vT0_W;
    TgVEC_M_F32_04                              m_vB0_W;
    TgVEC_M_F32_04                              m_vCL;
    TgVEC_M_F32_04                              m_vScale_U;
};




/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  File Local Functions                                                                                                                                                  */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

static TgSIZE                                        tgFX_Effect__Beam__Render_Quad_Count( P_STg2_FX__Beam );
static TgVOID                                        tgFX_Effect__Beam__Render_Init_Point( P_STg2_FX__Beam__Render_Point, PC_STg2_FX_Rnd_Output );
static TgVOID                                        tgFX_Effect__Beam__Render_Calculate_Point( P_STg2_FX__Beam__Render_Point, C_TgUINT32 );
static TgVOID                                        tgFX_Effect__Beam__Render_Common( P_STg2_FX__Beam__Render_Point, C_TgUINT32 );
TgFORCEINLINE TgBOOL                                 tgFX_Effect__Beam__Render_Calculate_Vertex_00(
                                                         P_STg2_RN_Vertex_Particle_00, C_TgSIZE, C_TgSIZE, P_STg2_FX__Beam__Render_Point );
TgFORCEINLINE TgBOOL                                 tgFX_Effect__Beam__Render_Calculate_Vertex_01(
                                                         P_STg2_RN_Vertex_Particle_01, C_TgSIZE, C_TgSIZE, P_STg2_FX__Beam__Render_Point );




/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Parent File Local Functions                                                                                                                                           */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

/* ---- tgFX__Render__Beam_Render_Memory_Particle_00 -------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
static TgSIZE tgFX__Render__Beam_Render_Memory_Particle_00( P_STg2_FX__Beam psBeam )
{
    return (4 * tgFX_Effect__Beam__Render_Quad_Count( psBeam ) * sizeof( STg2_RN_Vertex_Particle_00 ));
}


/* ---- tgFX__Render__Beam_Render_Memory_Particle_01 -------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
static TgSIZE tgFX__Render__Beam_Render_Memory_Particle_01( P_STg2_FX__Beam psBeam )
{
    return (4 * tgFX_Effect__Beam__Render_Quad_Count( psBeam ) * sizeof( STg2_RN_Vertex_Particle_01 ));
}


/* ---- tgFX__Render__Beam_Render_Generate_Particle_00 ------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
#define T(A) A##_00
#include "TgS Effect - Beam - Render.c_inc"
#undef T


/* ---- tgFX__Render__Beam_Render_Generate_Particle_01 ------------------------------------------------------------------------------------------------------------------ */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
#define T(A) A##_01
#include "TgS Effect - Beam - Render.c_inc"
#undef T




/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  File Local Functions                                                                                                                                                  */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

/* ---- tgFX_Effect__Beam__Render_Quad_Count ---------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
static TgSIZE tgFX_Effect__Beam__Render_Quad_Count( P_STg2_FX__Beam psBeam )
{
    TgFLOAT32                           fStart_Completion;
    TgFLOAT32                           fEnd_Completion;
    TgUINT32                            uiPoint;
    TgSIZE                              nuiQuad;

    if (TgTRUE == tgCM_NR1_F32( tgCM_MIN_F32( 1.0F, psBeam->m_fLive_Time / psBeam->m_fTime_Start__Duration ) ))
    {
        return (0);
    };

    fStart_Completion = tgCM_MAX_F32( 0.0F, 1.0F - (psBeam->m_fLife_Time / psBeam->m_fTime_End__Duration) );
    fEnd_Completion = tgCM_MIN_F32( 1.0F, psBeam->m_fLive_Time / psBeam->m_fTime_Start__Duration );

    uiPoint = 0;
    while (psBeam->m_psFile_Data->m_sShape.m_sData.m_pfShape_Fraction[uiPoint + 1] <= fStart_Completion)
    {
        ++uiPoint;
    };
    TgERROR( uiPoint < psBeam->m_psFile_Data->m_nuiPoints );

    nuiQuad = 0;
    while (uiPoint < psBeam->m_psFile_Data->m_nuiPoints)
    {
        if (psBeam->m_psFile_Data->m_sShape.m_sData.m_pfShape_Fraction[uiPoint] >= fEnd_Completion)
        {
            break;
        }
        ++nuiQuad;
        ++uiPoint;
    }

    return (nuiQuad);
}


/* ---- tgFX_Effect__Beam__Render_Init_Point ---------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
static TgVOID tgFX_Effect__Beam__Render_Init_Point( P_STg2_FX__Beam__Render_Point psPoint, PC_STg2_FX_Rnd_Output psRndOut )
{
    TgVEC_M_F32_04                      vEnd_Pos_M;

    /* Time 0: Start=0, End=0
       Time Time_Start__Duration: Start=0, End=1
       Time End - Time_End__Duration: Start=0, End=1
       Time End: Start=1, End=1 */

    psPoint->m_fStart_Completion = tgCM_MAX_F32( 0.0F, 1.0F - (psPoint->m_psBeam->m_fLife_Time / psPoint->m_psBeam->m_fTime_End__Duration) );
    psPoint->m_fEnd_Completion = tgCM_MIN_F32( 1.0F, psPoint->m_psBeam->m_fLive_Time / psPoint->m_psBeam->m_fTime_Start__Duration );
    psPoint->m_psFile_Data = psPoint->m_psBeam->m_psFile_Data;
    vEnd_Pos_M = M_ADD_F32_04( M_SETP_F32_04( psPoint->m_psBeam->m_sExtend.m_vPosition_Width_1 ), psPoint->m_psBeam->m_sExtend.m_vEnd_Variance );
    psPoint->m_vBeam_SG_M = M_SUB_F32_04( vEnd_Pos_M, M_SETP_F32_04( psPoint->m_psBeam->m_sExtend.m_vPosition_Width_0 ) );
    psPoint->m_vCam_Forward = psRndOut->m_psCamera->m_vCam_Forward.m_mData;
    TgERROR( TgTRUE != tgCM_NR1_F32( psPoint->m_fEnd_Completion ) );
    TgERROR( psPoint->m_psFile_Data->m_nuiPoints >= 2 );
}


/* ---- tgFX_Effect__Beam__Render_Calculate_Point ----------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
static TgVOID tgFX_Effect__Beam__Render_Calculate_Point( P_STg2_FX__Beam__Render_Point psPoint, C_TgUINT32 uiPoint )
{
    CP_TgVEC_M_F32_04                   pvShape_Offset;
    CP_TgFLOAT32                        pfLine_Fraction;
    CP_TgFLOAT32                        pfShape_Fraction;
    TgFLOAT32                           fSegment_Shape_Fraction;
    TgUINT32                            uiNext;
    TgUINT32                            uiPrev;
    TgVEC_M_F32_04                      vSegment_Offset_M;
    TgFLOAT32                           fSegment_Line_Fraction;
    TgVEC_M_F32_04                      vSegment_Line_Fraction;
    TgVEC_M_F32_04                      vSegment_Offset;
    TgVEC_M_F32_04                      vOffset;
    TgVEC_M_F32_04                      vPos_M;
    TgVEC_M_F32_04                      vPos_I;

    pvShape_Offset = psPoint->m_psFile_Data->m_sShape.m_sData.m_pvShape_Offset;
    pfLine_Fraction = psPoint->m_psFile_Data->m_sShape.m_sData.m_pfLine_Fraction;
    pfShape_Fraction = psPoint->m_psFile_Data->m_sShape.m_sData.m_pfShape_Fraction;

    fSegment_Shape_Fraction = pfShape_Fraction[uiPoint];

    if (fSegment_Shape_Fraction < psPoint->m_fStart_Completion)
    {
        uiNext = tgCM_MIN_U32( uiPoint + 1, psPoint->m_psFile_Data->m_nuiPoints - 1 );
        uiPrev = uiPoint;
    }
    else if (fSegment_Shape_Fraction > psPoint->m_fEnd_Completion)
    {
        uiNext = uiPoint;
        uiPrev = uiPoint > 0 ? uiPoint - 1 : 0;
    }
    else
    {
        uiNext = uiPoint;
        uiPrev = uiPoint;
    };

    if (uiNext != uiPrev)
    {
        TgFLOAT32                           fSegment_Length;
        TgFLOAT32                           fRelative_Position_In_Segment;
        TgFLOAT32                           fFraction_Of_Segment;
        TgVEC_M_F32_04                      vFraction_Of_Segment;

        fSegment_Length = pfShape_Fraction[uiNext] - pfShape_Fraction[uiPrev];
        fRelative_Position_In_Segment = fSegment_Shape_Fraction - pfShape_Fraction[uiPrev];
        fFraction_Of_Segment = (TgTRUE != tgCM_NR0_F32( fSegment_Length )) ? fRelative_Position_In_Segment / fSegment_Length : 0.0F;
        vFraction_Of_Segment = MS_SET1_F32_04( fFraction_Of_Segment );

        vSegment_Offset_M = M_MAD_F32_04( pvShape_Offset[uiNext], vFraction_Of_Segment, pvShape_Offset[uiPrev] );
        vSegment_Offset_M = M_NMS_F32_04( vFraction_Of_Segment, pvShape_Offset[uiPrev], vSegment_Offset_M );
        fSegment_Line_Fraction = tgCM_LRP_F32( pfLine_Fraction[uiPrev], pfLine_Fraction[uiNext], fFraction_Of_Segment );
    }
    else
    {
        vSegment_Offset_M = pvShape_Offset[uiPrev];
        fSegment_Line_Fraction = pfLine_Fraction[uiPrev];
    };

    vSegment_Line_Fraction = MS_SET1_F32_04( fSegment_Line_Fraction );
    vSegment_Offset = M_MUL_F32_04( psPoint->m_vBeam_SG_M, vSegment_Line_Fraction );
    vOffset = M_ADD_F32_04( vSegment_Offset_M, vSegment_Offset );
    vPos_M = M_ADD_F32_04( psPoint->m_psBeam->m_vPos_M, vOffset );
    vPos_I = M_QT_TX_F32_04( vPos_M, psPoint->m_psBeam->m_qRot_M2W );
    psPoint->m_vSN_W = M_ADD_F32_04( psPoint->m_psBeam->m_vPos_M2W, vPos_I );

#if TgS_DEBUG_EFFECT
    {
        TgBOOL                              bDraw;
        if ((TgTRUE == tgCN_Var_Query_Bool( &bDraw, T_NAME(g_tiFX_Debug__, __Draw_Debug) )) && (TgTRUE == bDraw))
        {
            tgRN_DBG_Sphere( KTg_YELLOW_709_U32, psPoint->m_vSN_W, 0.1F );
        };
    }
/*# TgS_DEBUG_EFFECT */
#endif
}


/* ---- tgFX_Effect__Beam__Render_Common -------------------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
static TgVOID tgFX_Effect__Beam__Render_Common( P_STg2_FX__Beam__Render_Point psPoint, C_TgUINT32 uiPoint )
{
    CP_STg2_FX__Beam__Extend_Data       psExtend;
    TgFLOAT32                           fShape_Fraction;
    TgVEC_M_F32_04                      vShape_Fraction;
    TgVEC_M_F32_04                      vWidth_0;
    TgVEC_M_F32_04                      vWidth_1;
    TgVEC_M_F32_04                      vWidth;
    TgVEC_M_F32_04                      vPrev_Pos_W;
    TgVEC_F32_04                        vLength;
    TgVEC_M_F32_04                      vQuad_BI;

    psExtend = &(psPoint->m_psBeam->m_sExtend);

    fShape_Fraction = tgCM_CLP_F32( psPoint->m_psFile_Data->m_sShape.m_sData.m_pfShape_Fraction[uiPoint], psPoint->m_fStart_Completion, psPoint->m_fEnd_Completion );

    vShape_Fraction = MS_SET1_F32_04( fShape_Fraction );
    psPoint->m_vScale_U = M_MUL_F32_04( psPoint->m_psBeam->m_psFile_Data->m_vScale_U, vShape_Fraction );
    vWidth_0 = M_SPW_F32_04( psExtend->m_vPosition_Width_0 );
    vWidth_1 = M_SPW_F32_04( psExtend->m_vPosition_Width_1 );
    vWidth = M_NMS_F32_04( vWidth_0, vShape_Fraction, M_MAD_F32_04( vWidth_1, vShape_Fraction, vWidth_0 ) );
    psPoint->m_vCL = M_NMS_F32_04( psExtend->m_vColour_0, vShape_Fraction, M_MAD_F32_04( psExtend->m_vColour_1, vShape_Fraction, psExtend->m_vColour_0 ) );

    vPrev_Pos_W = psPoint->m_vSN_W;
    tgFX_Effect__Beam__Render_Calculate_Point( psPoint, uiPoint );

    psPoint->m_vT0_W = M_NORM_LEN_F32_04( &vLength.m_mData, M_SUB_F32_04( psPoint->m_vSN_W, vPrev_Pos_W ) );
    if (TgTRUE != tgCM_NR0_F32( vLength.m.x ))
    {
        psPoint->m_vB0_W = M_UCX_F32_04( psPoint->m_vCam_Forward, psPoint->m_vT0_W );
        psPoint->m_vN0_W = M_CX_F32_04( psPoint->m_vT0_W, psPoint->m_vB0_W );
    }

    vQuad_BI = M_MUL_F32_04( psPoint->m_vB0_W, vWidth );
    psPoint->m_vS0_W = M_ADD_F32_04( vPrev_Pos_W, vQuad_BI );
    psPoint->m_vS1_W = M_SUB_F32_04( vPrev_Pos_W, vQuad_BI );

#if TgS_DEBUG_EFFECT
    {
        TgBOOL                              bDraw;
        if ((TgTRUE == tgCN_Var_Query_Bool( &bDraw, T_NAME(g_tiFX_Debug__, __Draw_Debug) )) && (TgTRUE == bDraw))
        {
            tgRN_DBG_Line( psPoint->m_vS0_W, KTg_GREEN_709_U32, psPoint->m_vS1_W, KTg_GREEN_709_U32 );
        };
    }
/*# TgS_DEBUG_EFFECT */
#endif
}


/* ---- tgFX_Effect__Beam__Render_Calculate_Vertex_00 ------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgFORCEINLINE TgBOOL tgFX_Effect__Beam__Render_Calculate_Vertex_00(
    P_STg2_RN_Vertex_Particle_00 psVert, C_TgSIZE uiPoint0, C_TgSIZE uiPoint1, P_STg2_FX__Beam__Render_Point psPoint )
{
    TgBOOL                              bQuad_Camera_Facing;
    TgVEC_F32_04                        vDirTest;

    vDirTest.m_mData = M_DOT_F32_04( psPoint->m_vN0_W, psPoint->m_vCam_Forward );
    bQuad_Camera_Facing = tgCM_NR0_F32( vDirTest.m.x );
    if (TgTRUE == bQuad_Camera_Facing)
    {
        psVert[uiPoint0].m_vS0.m_mData = psPoint->m_vS0_W;
        psVert[uiPoint0].m_vUV.m_mData = M_MAD_F32_04( psPoint->m_vScale_U, psPoint->m_psBeam->m_sExtend.m_vUV_01_Scale, psPoint->m_psBeam->m_sExtend.m_vUV_01_Constant );
        psVert[uiPoint1].m_vS0.m_mData = psPoint->m_vS1_W;
        psVert[uiPoint1].m_vUV.m_mData = M_MAD_F32_04( psPoint->m_psFile_Data->m_vScale_V, psPoint->m_psBeam->m_sExtend.m_vUV_01_Scale, psVert[uiPoint0].m_vUV.m_mData );
    }
    else
    {
        psVert[uiPoint1].m_vS0.m_mData = psPoint->m_vS0_W;
        psVert[uiPoint1].m_vUV.m_mData = M_MAD_F32_04( psPoint->m_vScale_U, psPoint->m_psBeam->m_sExtend.m_vUV_01_Scale, psPoint->m_psBeam->m_sExtend.m_vUV_01_Constant );
        psVert[uiPoint0].m_vS0.m_mData = psPoint->m_vS1_W;
        psVert[uiPoint0].m_vUV.m_mData = M_MAD_F32_04( psPoint->m_psFile_Data->m_vScale_V, psPoint->m_psBeam->m_sExtend.m_vUV_01_Scale, psVert[uiPoint1].m_vUV.m_mData );
    };

    psVert[uiPoint0].m_vCL.m_mData = psPoint->m_vCL;
    psVert[uiPoint1].m_vCL.m_mData = psPoint->m_vCL;

    return (bQuad_Camera_Facing);
}


/* ---- tgFX_Effect__Beam__Render_Calculate_Vertex_01 ------------------------------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
TgFORCEINLINE TgBOOL tgFX_Effect__Beam__Render_Calculate_Vertex_01(
    P_STg2_RN_Vertex_Particle_01 psVert, C_TgSIZE uiPoint0, C_TgSIZE uiPoint1, P_STg2_FX__Beam__Render_Point psPoint )
{
    TgBOOL                              bQuad_Camera_Facing;
    TgVEC_F32_04                        vDirTest;

    vDirTest.m_mData = M_DOT_F32_04( psPoint->m_vN0_W, psPoint->m_vCam_Forward );
    bQuad_Camera_Facing = tgCM_NR0_F32( vDirTest.m.x );
    if (TgTRUE == bQuad_Camera_Facing)
    {
        psVert[uiPoint0].m_vS0.m_mData = psPoint->m_vS0_W;
        psVert[uiPoint0].m_vUV.m_mData = M_MAD_F32_04( psPoint->m_vScale_U, psPoint->m_psBeam->m_sExtend.m_vUV_01_Scale, psPoint->m_psBeam->m_sExtend.m_vUV_01_Constant );
        psVert[uiPoint1].m_vS0.m_mData = psPoint->m_vS1_W;
        psVert[uiPoint1].m_vUV.m_mData = M_MAD_F32_04( psPoint->m_psFile_Data->m_vScale_V, psPoint->m_psBeam->m_sExtend.m_vUV_01_Scale, psVert[uiPoint0].m_vUV.m_mData );
    }
    else
    {
        psVert[uiPoint1].m_vS0.m_mData = psPoint->m_vS0_W;
        psVert[uiPoint1].m_vUV.m_mData = M_MAD_F32_04( psPoint->m_vScale_U, psPoint->m_psBeam->m_sExtend.m_vUV_01_Scale, psPoint->m_psBeam->m_sExtend.m_vUV_01_Constant );
        psVert[uiPoint0].m_vS0.m_mData = psPoint->m_vS1_W;
        psVert[uiPoint0].m_vUV.m_mData = M_MAD_F32_04( psPoint->m_psFile_Data->m_vScale_V, psPoint->m_psBeam->m_sExtend.m_vUV_01_Scale, psVert[uiPoint1].m_vUV.m_mData );
    };

    psVert[uiPoint0].m_vT0.m_mData = psPoint->m_vT0_W;
    psVert[uiPoint0].m_vB0.m_mData = psPoint->m_vB0_W;
    psVert[uiPoint0].m_vCL.m_mData = psPoint->m_vCL;
    psVert[uiPoint1].m_vT0.m_mData = psPoint->m_vT0_W;
    psVert[uiPoint1].m_vB0.m_mData = psPoint->m_vB0_W;
    psVert[uiPoint1].m_vCL.m_mData = psPoint->m_vCL;

    return (bQuad_Camera_Facing);
}