BRL-CAD
liboptical (Optical)

Debugging logic for the BRL-CAD Optical Library, LIBOPTICAL. More...

Files

file  debug.h
 
file  defines.h
 
file  light.h
 Declarations related to light sources.
 
file  plastic.h
 
file  shadefuncs.h
 
file  shadework.h
 
file  optical.h
 Header file for the BRL-CAD Optical Library, LIBOPTICAL.
 

Data Structures

struct  floatpixel
 
struct  light_pt
 
struct  light_specific
 
struct  phong_specific
 
struct  mfuncs
 
struct  shadework
 

Macros

#define OPTICAL_DEBUG   optical_debug
 
#define OPTICAL_DEBUG_HITS   0x00000001 /* 1 Print hits used by view() */
 
#define OPTICAL_DEBUG_MATERIAL   0x00000002 /* 2 Material properties */
 
#define OPTICAL_DEBUG_SHOWERR   0x00000004 /* 3 Colorful markers on errors */
 
#define OPTICAL_DEBUG_RTMEM   0x00000008 /* 4 Debug librt mem after startup */
 
#define OPTICAL_DEBUG_SHADE   0x00000010 /* 5 Shading calculation */
 
#define OPTICAL_DEBUG_PARSE   0x00000020 /* 6 Command parsing */
 
#define OPTICAL_DEBUG_LIGHT   0x00000040 /* 7 Debug lighting */
 
#define OPTICAL_DEBUG_REFRACT   0x00000080 /* 8 Debug reflection & refraction */
 
#define OPTICAL_DEBUG_STATS   0x00000200 /* 10 Print more statistics */
 
#define OPTICAL_DEBUG_RTMEM_END   0x00000400 /* 11 Print librt mem use on 'clean' */
 
#define OPTICAL_DEBUG_MISSPLOT   0x20000000 /* 30 plot(5) missed rays to stdout */
 
#define OPTICAL_DEBUG_RAYWRITE   0x40000000 /* 31 Ray(5V) view rays to stdout */
 
#define OPTICAL_DEBUG_RAYPLOT   0x80000000 /* 32 plot(5) rays to stdout */
 
#define OPTICAL_DEBUG_FORMAT
 
#define LPT_MAGIC   0x327649
 
#define SOME_LIGHT_SAMPLES   128
 
#define LIGHT_NULL   ((struct light_specific *)0)
 
#define RT_CK_LIGHT(_p)   BU_CKMAG((_p), LIGHT_MAGIC, "light_specific")
 
#define PL_NULL   ((struct phong_specific *)0)
 
#define PL_O(m)   offsetof(struct phong_specific, m)
 
#define MF_NULL   ((struct mfuncs *)0)
 
#define RT_CK_MF(_p)   BU_CKMAG(_p, MF_MAGIC, "mfuncs")
 
#define MFI_NORMAL   0x01
 Need normal. More...
 
#define MFI_UV   0x02
 Need uv. More...
 
#define MFI_LIGHT   0x04
 Need light visibility. More...
 
#define MFI_HIT   0x08
 Need just hit point. More...
 
#define MFI_FORMAT
 
#define MFF_PROC   0x01
 shader is procedural, computes tr/re/hits More...
 
#define SW_NLIGHTS   16 /* Max # of light sources */
 

Functions

void light_cleanup (void)
 
void light_maker (int num, mat_t v2m)
 
int light_init (struct application *ap)
 
void light_obs (struct application *ap, struct shadework *swp, int have)
 
void mlib_add_shader (struct mfuncs **headp, struct mfuncs *mfp1)
 
int mlib_setup (struct mfuncs **headp, struct region *rp, struct rt_i *rtip)
 
void mlib_free (struct region *rp)
 
struct mfuncsload_dynamic_shader (const char *material)
 
void pr_shadework (const char *str, const struct shadework *swp)
 
void optical_shader_init (struct mfuncs **headp)
 
int mlib_zero (struct application *, const struct partition *, struct shadework *, void *)
 
int mlib_one (struct region *, struct bu_vls *, void **, const struct mfuncs *, struct rt_i *)
 
void mlib_void (struct region *, void *)
 
int rr_render (struct application *app, const struct partition *pp, struct shadework *swp)
 
void shade_inputs (struct application *app, const struct partition *pp, struct shadework *swp, int want)
 
void wray (struct partition *pp, struct application *app, FILE *fp, const vect_t inormal)
 
void wraypts (vect_t in, vect_t inorm, vect_t out, int id, struct application *app, FILE *fp)
 
void wraypaint (vect_t start, vect_t norm, int paint, struct application *app, FILE *fp)
 
int viewshade (struct application *app, const struct partition *pp, struct shadework *swp)
 
const char * optical_version (void)
 

Variables

unsigned int optical_debug
 
double AmbientIntensity
 
vect_t background
 
struct region env_region
 
int max_bounces
 
int max_ireflect
 
struct light_specific LightHead
 
struct bu_structparse phong_parse []
 

Detailed Description

Debugging logic for the BRL-CAD Optical Library, LIBOPTICAL.

Definitions for the BRL-CAD Optical Library, LIBOPTICAL.

Macro Definition Documentation

◆ OPTICAL_DEBUG

#define OPTICAL_DEBUG   optical_debug

Definition at line 45 of file debug.h.

◆ OPTICAL_DEBUG_HITS

#define OPTICAL_DEBUG_HITS   0x00000001 /* 1 Print hits used by view() */

Definition at line 57 of file debug.h.

◆ OPTICAL_DEBUG_MATERIAL

#define OPTICAL_DEBUG_MATERIAL   0x00000002 /* 2 Material properties */

Definition at line 58 of file debug.h.

◆ OPTICAL_DEBUG_SHOWERR

#define OPTICAL_DEBUG_SHOWERR   0x00000004 /* 3 Colorful markers on errors */

Definition at line 59 of file debug.h.

◆ OPTICAL_DEBUG_RTMEM

#define OPTICAL_DEBUG_RTMEM   0x00000008 /* 4 Debug librt mem after startup */

Definition at line 60 of file debug.h.

◆ OPTICAL_DEBUG_SHADE

#define OPTICAL_DEBUG_SHADE   0x00000010 /* 5 Shading calculation */

Definition at line 61 of file debug.h.

◆ OPTICAL_DEBUG_PARSE

#define OPTICAL_DEBUG_PARSE   0x00000020 /* 6 Command parsing */

Definition at line 62 of file debug.h.

◆ OPTICAL_DEBUG_LIGHT

#define OPTICAL_DEBUG_LIGHT   0x00000040 /* 7 Debug lighting */

Definition at line 63 of file debug.h.

◆ OPTICAL_DEBUG_REFRACT

#define OPTICAL_DEBUG_REFRACT   0x00000080 /* 8 Debug reflection & refraction */

Definition at line 64 of file debug.h.

◆ OPTICAL_DEBUG_STATS

#define OPTICAL_DEBUG_STATS   0x00000200 /* 10 Print more statistics */

Definition at line 66 of file debug.h.

◆ OPTICAL_DEBUG_RTMEM_END

#define OPTICAL_DEBUG_RTMEM_END   0x00000400 /* 11 Print librt mem use on 'clean' */

Definition at line 67 of file debug.h.

◆ OPTICAL_DEBUG_MISSPLOT

#define OPTICAL_DEBUG_MISSPLOT   0x20000000 /* 30 plot(5) missed rays to stdout */

Definition at line 70 of file debug.h.

◆ OPTICAL_DEBUG_RAYWRITE

#define OPTICAL_DEBUG_RAYWRITE   0x40000000 /* 31 Ray(5V) view rays to stdout */

Definition at line 71 of file debug.h.

◆ OPTICAL_DEBUG_RAYPLOT

#define OPTICAL_DEBUG_RAYPLOT   0x80000000 /* 32 plot(5) rays to stdout */

Definition at line 72 of file debug.h.

◆ OPTICAL_DEBUG_FORMAT

#define OPTICAL_DEBUG_FORMAT
Value:
"\020" /* print hex */ \
"\040RAYPLOT" \
"\037RAYWRITE" \
"\036MISSPLOT" \
/* many unused */ \
"\013RTMEM_END" \
"\012STATS" \
"\011UNUSED" \
"\010REFRACT" \
"\7LIGHT" \
"\6PARSE" \
"\5SHADE" \
"\4RTMEM" \
"\3SHOWERR" \
"\2MATERIAL" \
"\1HITS"

Definition at line 74 of file debug.h.

◆ LPT_MAGIC

#define LPT_MAGIC   0x327649

Definition at line 47 of file light.h.

◆ SOME_LIGHT_SAMPLES

#define SOME_LIGHT_SAMPLES   128

Definition at line 48 of file light.h.

◆ LIGHT_NULL

#define LIGHT_NULL   ((struct light_specific *)0)

Definition at line 76 of file light.h.

◆ RT_CK_LIGHT

#define RT_CK_LIGHT (   _p)    BU_CKMAG((_p), LIGHT_MAGIC, "light_specific")

Definition at line 77 of file light.h.

◆ PL_NULL

#define PL_NULL   ((struct phong_specific *)0)

Definition at line 30 of file plastic.h.

◆ PL_O

#define PL_O (   m)    offsetof(struct phong_specific, m)

Definition at line 31 of file plastic.h.

◆ MF_NULL

#define MF_NULL   ((struct mfuncs *)0)

Definition at line 60 of file shadefuncs.h.

◆ RT_CK_MF

#define RT_CK_MF (   _p)    BU_CKMAG(_p, MF_MAGIC, "mfuncs")

Definition at line 61 of file shadefuncs.h.

◆ MFI_NORMAL

#define MFI_NORMAL   0x01

Need normal.

Definition at line 67 of file shadefuncs.h.

◆ MFI_UV

#define MFI_UV   0x02

Need uv.

Definition at line 68 of file shadefuncs.h.

◆ MFI_LIGHT

#define MFI_LIGHT   0x04

Need light visibility.

Definition at line 69 of file shadefuncs.h.

◆ MFI_HIT

#define MFI_HIT   0x08

Need just hit point.

Definition at line 70 of file shadefuncs.h.

◆ MFI_FORMAT

#define MFI_FORMAT
Value:
"\020" /* print hex */ \
"\4HIT" \
"\3LIGHT" \
"\2UV" \
"\1NORMAL"

for bu_printb()

Definition at line 73 of file shadefuncs.h.

◆ MFF_PROC

#define MFF_PROC   0x01

shader is procedural, computes tr/re/hits

Definition at line 81 of file shadefuncs.h.

◆ SW_NLIGHTS

#define SW_NLIGHTS   16 /* Max # of light sources */

Definition at line 37 of file shadework.h.

Function Documentation

◆ light_cleanup()

void light_cleanup ( void  )

◆ light_maker()

void light_maker ( int  num,
mat_t  v2m 
)

◆ light_init()

int light_init ( struct application ap)

◆ light_obs()

void light_obs ( struct application ap,
struct shadework swp,
int  have 
)

◆ mlib_add_shader()

void mlib_add_shader ( struct mfuncs **  headp,
struct mfuncs mfp1 
)

◆ mlib_setup()

int mlib_setup ( struct mfuncs **  headp,
struct region rp,
struct rt_i rtip 
)

◆ mlib_free()

void mlib_free ( struct region rp)

◆ load_dynamic_shader()

struct mfuncs * load_dynamic_shader ( const char *  material)

Given a shader/material name, try to find a DSO to supply the shader.

◆ pr_shadework()

void pr_shadework ( const char *  str,
const struct shadework swp 
)

◆ optical_shader_init()

void optical_shader_init ( struct mfuncs **  headp)

this function sets the provided mfuncs head pointer to the list of available shaders. the provided mfuncs head pointer should point to MF_NULL prior to getting passed to optical_shader_init() so that the same shader list may be returned repeatably.

◆ mlib_zero()

int mlib_zero ( struct application ,
const struct partition ,
struct shadework ,
void *   
)

◆ mlib_one()

int mlib_one ( struct region ,
struct bu_vls ,
void **  ,
const struct mfuncs ,
struct rt_i  
)

◆ mlib_void()

void mlib_void ( struct region ,
void *   
)

◆ rr_render()

int rr_render ( struct application app,
const struct partition pp,
struct shadework swp 
)

◆ shade_inputs()

void shade_inputs ( struct application app,
const struct partition pp,
struct shadework swp,
int  want 
)

◆ wray()

void wray ( struct partition pp,
struct application app,
FILE *  fp,
const vect_t  inormal 
)

◆ wraypts()

void wraypts ( vect_t  in,
vect_t  inorm,
vect_t  out,
int  id,
struct application app,
FILE *  fp 
)

◆ wraypaint()

void wraypaint ( vect_t  start,
vect_t  norm,
int  paint,
struct application app,
FILE *  fp 
)

◆ viewshade()

int viewshade ( struct application app,
const struct partition pp,
struct shadework swp 
)

◆ optical_version()

const char * optical_version ( void  )

Variable Documentation

◆ optical_debug

unsigned int optical_debug
extern

◆ AmbientIntensity

double AmbientIntensity
extern

◆ background

vect_t background
extern

◆ env_region

struct region env_region
extern

◆ max_bounces

int max_bounces
extern

◆ max_ireflect

int max_ireflect
extern

◆ LightHead

struct light_specific LightHead
extern

◆ phong_parse

struct bu_structparse phong_parse[]
extern