BRL-CAD
sh_rtrans.c File Reference
#include "common.h"
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "vmath.h"
#include "raytrace.h"
#include "optical.h"
Include dependency graph for sh_rtrans.c:

Go to the source code of this file.

Data Structures

struct  rtrans_specific
 

Macros

#define RTRANS_MAGIC   0x4a6f686e
 
#define CK_RTRANS_SP(_p)   BU_CKMAG(_p, RTRANS_MAGIC, "rtrans_specific")
 
#define SHDR_NULL   ((struct rtrans_specific *)0)
 
#define SHDR_O(m)   bu_offsetof(struct rtrans_specific, m)
 

Functions

HIDDEN int rtrans_setup (register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
 
HIDDEN int rtrans_render (struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
 
HIDDEN void rtrans_print (register struct region *rp, void *dp)
 
HIDDEN void rtrans_free (void *cp)
 

Variables

struct bu_structparse rtrans_parse []
 
struct mfuncs rtrans_mfuncs []
 

Detailed Description

Random transparency shader. A random number from 0 to 1 is drawn for each pixel rendered. If the random number is less than the threshold value, the pixel is rendered as 100% transparent

Definition in file sh_rtrans.c.

Macro Definition Documentation

#define RTRANS_MAGIC   0x4a6f686e

Definition at line 40 of file sh_rtrans.c.

#define CK_RTRANS_SP (   _p)    BU_CKMAG(_p, RTRANS_MAGIC, "rtrans_specific")

Definition at line 46 of file sh_rtrans.c.

Referenced by rtrans_render().

#define SHDR_NULL   ((struct rtrans_specific *)0)

Definition at line 55 of file sh_rtrans.c.

#define SHDR_O (   m)    bu_offsetof(struct rtrans_specific, m)

Definition at line 56 of file sh_rtrans.c.

Function Documentation

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

Definition at line 82 of file sh_rtrans.c.

References BN_RANDSEED, BU_CK_VLS, BU_GET, bu_struct_parse(), bu_struct_print(), rtrans_specific::next_rand, rdebug, RDEBUG_SHADE, region::reg_name, RT_CHECK_RTI, and RT_CK_REGION.

Here is the call graph for this function:

int rtrans_render ( struct application ap,
const struct partition pp,
struct shadework *  swp,
void *  dp 
)

Definition at line 130 of file sh_rtrans.c.

References BN_RANDOM, bu_struct_print(), CK_RTRANS_SP, rtrans_specific::next_rand, rdebug, RDEBUG_SHADE, rr_render(), RT_AP_CHECK, RT_CHECK_PT, rtrans_specific::threshold, and VSETALL.

Here is the call graph for this function:

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

Definition at line 112 of file sh_rtrans.c.

References bu_struct_print(), and region::reg_name.

Here is the call graph for this function:

HIDDEN void rtrans_free ( void *  cp)

Definition at line 119 of file sh_rtrans.c.

References BU_PUT.

Variable Documentation

struct bu_structparse rtrans_parse[]
Initial value:
= {
{"%g", 1, "threshold", SHDR_O(threshold), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "t", SHDR_O(threshold), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
#define SHDR_O(m)
Definition: sh_rtrans.c:56

Definition at line 58 of file sh_rtrans.c.

struct mfuncs rtrans_mfuncs[]
Initial value:
= {
{0, (char *)0, 0, 0, 0, 0, 0, 0, 0 }
}
HIDDEN void rtrans_free(void *cp)
Definition: sh_rtrans.c:119
HIDDEN void rtrans_print(register struct region *rp, void *dp)
Definition: sh_rtrans.c:112
HIDDEN int rtrans_setup(register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
Definition: sh_rtrans.c:82
#define MF_MAGIC
Definition: magic.h:205
HIDDEN int rtrans_render(struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
Definition: sh_rtrans.c:130

Definition at line 70 of file sh_rtrans.c.

Referenced by optical_shader_init().