gfxstatic.c 6.87 KB
/*====================================================================
 * gfxstatic.c
 *
 * Synopsis:
 *
 *    Datafiles obtained from Multigen flt demo directory.
 *
 * Copyright 1993, Silicon Graphics, Inc.
 * All Rights Reserved.
 *
 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
 * Inc.; the contents of this file may not be disclosed to third
 * parties, copied or duplicated in any form, in whole or in part,
 * without the prior written permission of Silicon Graphics, Inc.
 *
 * RESTRICTED RIGHTS LEGEND:
 * Use, duplication or disclosure by the Government is subject to
 * restrictions as set forth in subdivision (c)(1)(ii) of the Rights
 * in Technical Data and Computer Software clause at DFARS
 * 252.227-7013, and/or in similar or successor clauses in the FAR,
 * DOD or NASA FAR Supplement. Unpublished - rights reserved under the
 * Copyright Laws of the United States.
 *====================================================================*/

#include <ultra64.h>
#include "gfx.h"


#include "sphere10.h"
#include "sphere12.h"
#include "sphere17.h"
#include "mahogany.h"

Gfx sphere10[] = {

#include "sphere10.c"

    gsSPEndDisplayList(),
};

Gfx sphere12[] = {

#include "sphere12.c"

    gsSPEndDisplayList(),
};

Gfx sphere17[] = {

#include "sphere17.c"

    gsSPEndDisplayList(),
};


/*
 * The sun (uses sphere3 since assumes sun will be far away)
 */

#define SUN_AMBIENT_R	250
#define SUN_AMBIENT_G	250
#define SUN_AMBIENT_B	0

#define SUN_DIFFUSE_R	250
#define SUN_DIFFUSE_G	250
#define SUN_DIFFUSE_B	0

#define SUN_DIR_X	0
#define SUN_DIR_Y	-127
#define SUN_DIR_Z	0


Lights1 sunLight = gdSPDefLights1(
      SUN_AMBIENT_R, SUN_AMBIENT_G, SUN_AMBIENT_B,
      0, 0, 0,
      SUN_DIR_X,     SUN_DIR_Y,     SUN_DIR_Z); 

Gfx sun_dl[] = {

    gsDPPipeSync(),
    gsSPClearGeometryMode(0xffffffff),
    gsSPSetGeometryMode(G_ZBUFFER | G_CULL_BACK | G_LIGHTING | 
                        G_SHADE | G_SHADING_SMOOTH),
    gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, SCREEN_WD, SCREEN_HT),
    gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
    gsDPSetCombineKey(G_CK_NONE),
    gsDPSetAlphaCompare(G_AC_NONE),
    gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),

    gsSPSetLights1(sunLight),
    gsSPDisplayList(sphere12),

    gsSPEndDisplayList(),

};



/*
 *  Mercury planet
 */
#define MERCURY_AMBIENT_R	128
#define MERCURY_AMBIENT_G	8
#define MERCURY_AMBIENT_B	0

Lights1 mercuryLight = gdSPDefLights1(
      MERCURY_AMBIENT_R, MERCURY_AMBIENT_G, MERCURY_AMBIENT_B,
      SUN_DIFFUSE_R,     SUN_DIFFUSE_G,     SUN_DIFFUSE_B,
      -56,    -113,       0); 

Gfx mercury_dl[] = {

    gsDPPipeSync(),
    gsSPClearGeometryMode(0xffffffff),
    gsSPSetGeometryMode(G_ZBUFFER | G_CULL_BACK | G_LIGHTING | 
                        G_SHADE | G_SHADING_SMOOTH),
    gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, SCREEN_WD, SCREEN_HT),
    gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
    gsDPSetCombineKey(G_CK_NONE),
    gsDPSetAlphaCompare(G_AC_NONE),
    gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
    gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_OFF),

    gsSPSetLights1(mercuryLight),
    gsSPDisplayList(sphere12),

    gsSPEndDisplayList(),

};


/*
 *  Venus planet
 */
#define VENUS_AMBIENT_R	25
#define VENUS_AMBIENT_G	75
#define VENUS_AMBIENT_B	50

Lights1 venusLight = gdSPDefLights1(
      VENUS_AMBIENT_R, VENUS_AMBIENT_G, VENUS_AMBIENT_B,
      SUN_DIFFUSE_R,   SUN_DIFFUSE_G,   SUN_DIFFUSE_B,
      -65,    -108,       0); 

Gfx venus_dl[] = {

    gsDPPipeSync(),
    gsSPClearGeometryMode(0xffffffff),
    gsSPSetGeometryMode(G_ZBUFFER | G_CULL_BACK | G_LIGHTING | 
                        G_SHADE | G_SHADING_SMOOTH),
    gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, SCREEN_WD, SCREEN_HT),
    gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
    gsDPSetCombineKey(G_CK_NONE),
    gsDPSetAlphaCompare(G_AC_NONE),
    gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),

    gsSPSetLights1(venusLight),

    gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
    gsDPSetCombineMode (G_CC_MODULATERGBA, G_CC_MODULATERGBA),
    gsDPSetTexturePersp (G_TP_PERSP),
    gsDPSetTextureDetail (G_TD_CLAMP),
    gsDPSetTextureLOD (G_TL_TILE),
    gsDPSetTextureLUT (G_TT_NONE),
    gsDPSetTextureFilter (G_TF_BILERP),
    gsDPSetTextureConvert(G_TC_FILT),
    gsDPLoadTextureBlock (mahogany, G_IM_FMT_IA, G_IM_SIZ_16b, 32, 32, 0,
      G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR,
      5, 5, 3, 4),

    gsSPDisplayList(sphere10),

    gsSPEndDisplayList(),

};


/*
 *  Earth planet
 */
#define EARTH_AMBIENT_R	61
#define EARTH_AMBIENT_G	74
#define EARTH_AMBIENT_B	157

Lights1 earthLight = gdSPDefLights1(
      EARTH_AMBIENT_R, EARTH_AMBIENT_G, EARTH_AMBIENT_B,
      SUN_DIFFUSE_R,   SUN_DIFFUSE_G,   SUN_DIFFUSE_B,
      65,    -108,       0); 

Gfx earth_dl[] = {

    gsDPPipeSync(),
    gsSPClearGeometryMode(0xffffffff),
    gsSPSetGeometryMode(G_ZBUFFER | G_CULL_BACK | G_LIGHTING |
                        G_SHADE | G_SHADING_SMOOTH),
    gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, SCREEN_WD, SCREEN_HT),
    gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
    gsDPSetCombineKey(G_CK_NONE),
    gsDPSetAlphaCompare(G_AC_NONE),
    gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),

    gsSPSetLights1(earthLight),

    gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
    gsDPSetCombineMode (G_CC_MODULATERGBA, G_CC_MODULATERGBA),
    gsDPSetTexturePersp (G_TP_PERSP),
    gsDPSetTextureDetail (G_TD_CLAMP),
    gsDPSetTextureLOD (G_TL_TILE),
    gsDPSetTextureLUT (G_TT_NONE),
    gsDPSetTextureFilter (G_TF_BILERP),
    gsDPSetTextureConvert(G_TC_FILT),
    gsDPLoadTextureBlock (mahogany, G_IM_FMT_IA, G_IM_SIZ_16b, 32, 32, 0,
      G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR,
      5, 5, 3, 4),

    gsSPDisplayList(sphere17),

    gsSPEndDisplayList(),

};


/*
 * Bump-mapped cratered planet
 */
#include "obj_dls.h"
Gfx craterplanet_dl[] = {

    gsDPPipeSync(),
    gsDPPipeSync(),
    gsSPClearGeometryMode(0xffffffff),
    gsSPSetGeometryMode(G_ZBUFFER | G_CULL_BACK | G_SHADE | G_SHADING_SMOOTH),
    gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),

    /*
     * The texture scaling parameters are .16 format. In order to
     * get an exact texture scale of 1.0, we scale above by 2.0, and
     * scale down here by 0.5
     */
    gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
    gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
    gsDPSetCombineMode(G_CC_MODULATERGBDECALA, G_CC_MODULATERGBDECALA),
    gsDPSetTextureLOD(G_TL_TILE),
    gsDPPipeSync(),
    gsDPLoadTLUT_pal256( obj0_tlut ),
    gsDPPipeSync(),
    gsDPSetTextureLUT( G_TT_RGBA16 ),
    gsDPSetTextureFilter(G_TF_BILERP),

    gsSPDisplayList( obj0_dl ),

    gsDPSetTextureLUT( G_TT_NONE ),
    gsSPTexture(0, 0, 0, 0, G_OFF), /* done; turn texture off */
    gsSPEndDisplayList(),

};


#ifdef MVTVIEW
/*
 *  MVT Object definitions
 */
#include "mvtview_dl.h"
#include "enterprise_mvt_dl.h"
#endif