BRL-CAD
sh_plastic.c File Reference
#include "common.h"
#include <stddef.h>
#include <stdio.h>
#include <math.h>
#include "vmath.h"
#include "mater.h"
#include "raytrace.h"
#include "optical.h"
#include "light.h"
#include "plastic.h"
#include "photonmap.h"
Include dependency graph for sh_plastic.c:

Go to the source code of this file.

Macros

#define PHAST_PHONG   1 /* See Graphics Gems IV pg 387 */
 
#define RI_AIR   1.0 /* Refractive index of air. */
 

Functions

HIDDEN int phong_setup (register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
 
HIDDEN int mirror_setup (register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
 
HIDDEN int glass_setup (register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
 
HIDDEN int phong_render (register struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
 
HIDDEN void phong_print (register struct region *rp, void *dp)
 
HIDDEN void phong_free (void *cp)
 

Variables

double AmbientIntensity
 
struct bu_structparse phong_parse []
 
struct mfuncs phg_mfuncs []
 

Detailed Description

Notes - The normals on all surfaces point OUT of the solid. The incoming light rays point IN. Thus the sign change.

Definition in file sh_plastic.c.

Macro Definition Documentation

#define PHAST_PHONG   1 /* See Graphics Gems IV pg 387 */

Definition at line 48 of file sh_plastic.c.

#define RI_AIR   1.0 /* Refractive index of air. */

Definition at line 97 of file sh_plastic.c.

Referenced by phong_setup().

Function Documentation

HIDDEN int phong_setup ( register struct region rp,
struct bu_vls matparm,
void **  dpp,
const struct mfuncs *  mfp,
struct rt_i rtip 
)

Definition at line 100 of file sh_plastic.c.

References BU_CK_VLS, BU_GET, BU_PUT, bu_struct_parse(), PL_MAGIC, region::reg_transmit, and RI_AIR.

Here is the call graph for this function:

HIDDEN int mirror_setup ( register struct region rp,
struct bu_vls matparm,
void **  dpp,
const struct mfuncs *  mfp,
struct rt_i rtip 
)

Definition at line 130 of file sh_plastic.c.

References BU_CK_VLS, BU_GET, BU_PUT, bu_struct_parse(), PL_MAGIC, and region::reg_transmit.

Here is the call graph for this function:

HIDDEN int glass_setup ( register struct region rp,
struct bu_vls matparm,
void **  dpp,
const struct mfuncs *  mfp,
struct rt_i rtip 
)

Definition at line 160 of file sh_plastic.c.

References BU_CK_VLS, BU_GET, BU_PUT, bu_struct_parse(), PL_MAGIC, and region::reg_transmit.

Here is the call graph for this function:

HIDDEN void phong_print ( register struct region rp,
void *  dp 
)

Definition at line 191 of file sh_plastic.c.

References bu_struct_print(), and region::reg_name.

Here is the call graph for this function:

HIDDEN void phong_free ( void *  cp)

Definition at line 198 of file sh_plastic.c.

References BU_PUT.

Variable Documentation

struct bu_structparse phong_parse[]
Initial value:
= {
{"%d", 1, "shine", PL_O(shine), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "sh", PL_O(shine), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "specular", PL_O(wgt_specular), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "sp", PL_O(wgt_specular), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "diffuse", PL_O(wgt_diffuse), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "di", PL_O(wgt_diffuse), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "transmit", PL_O(transmit), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "tr", PL_O(transmit), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "reflect", PL_O(reflect), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "re", PL_O(reflect), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "ri", PL_O(refrac_index), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "extinction_per_meter", PL_O(extinction), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "extinction", PL_O(extinction), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "ex", PL_O(extinction), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 3, "emission", PL_O(emission), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 3, "em", PL_O(emission), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
#define PL_O(_m)
Definition: vrml_write.c:76
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153

Definition at line 54 of file sh_plastic.c.

Referenced by GetMaterial().