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

Go to the source code of this file.

Data Structures

struct  noise_specific
 

Macros

#define noise_MAGIC   0x1847
 
#define CK_noise_SP(_p)   BU_CKMAG(_p, noise_MAGIC, "noise_specific")
 
#define SHDR_NULL   ((struct noise_specific *)0)
 
#define SHDR_O(m)   bu_offsetof(struct noise_specific, m)
 
#define RESCALE_NOISE(n)   n += 1.0
 

Functions

void noise_deg_to_rad (const struct bu_structparse *sdp, const char *name, void *base, const char *value, void *data)
 
HIDDEN int noise_setup (register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
 
HIDDEN void noise_print (register struct region *rp, void *dp)
 
HIDDEN void noise_free (void *cp)
 
int fractal_render (struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
 

Variables

struct bu_structparse noise_print_tab []
 
struct bu_structparse noise_parse_tab []
 
struct mfuncs noise_mfuncs []
 

Detailed Description

Shaders: gravel turbulence noise applied to color and surface normal turbump turbulence noise applied to surface normal turcolor turbulence noise applied to color fbmbump fbm noise applied to surface normal fbmcolor fbm noise applied to color

Definition in file sh_noise.c.

Macro Definition Documentation

#define noise_MAGIC   0x1847

Definition at line 45 of file sh_noise.c.

#define CK_noise_SP (   _p)    BU_CKMAG(_p, noise_MAGIC, "noise_specific")

Definition at line 46 of file sh_noise.c.

Referenced by fractal_render().

#define SHDR_NULL   ((struct noise_specific *)0)

Definition at line 108 of file sh_noise.c.

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

Definition at line 109 of file sh_noise.c.

#define RESCALE_NOISE (   n)    n += 1.0

Definition at line 248 of file sh_noise.c.

Referenced by fractal_render().

Function Documentation

void noise_deg_to_rad ( const struct bu_structparse sdp,
const char *  name,
void *  base,
const char *  value,
void *  data 
)

Definition at line 49 of file sh_noise.c.

References bu_structparse::sp_offset.

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

Definition at line 237 of file sh_noise.c.

References bu_struct_print(), and region::reg_name.

Here is the call graph for this function:

HIDDEN void noise_free ( void *  cp)

Definition at line 244 of file sh_noise.c.

References BU_PUT.

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

Definition at line 324 of file sh_noise.c.

References bn_noise_fbm(), bn_noise_turb(), bu_log(), bu_struct_print(), CK_noise_SP, noise_specific::h_val, noise_specific::lacunarity, noise_specific::m_to_sh, noise_specific::minval, noise_mfuncs, noise_specific::octaves, rdebug, RDEBUG_SHADE, RESCALE_NOISE, rr_render(), RT_AP_CHECK, RT_CHECK_PT, noise_specific::shader_number, and V3ARGS.

Here is the call graph for this function:

Variable Documentation

struct bu_structparse noise_print_tab[]
Initial value:
= {
{"%g", 1, "lacunarity", SHDR_O(lacunarity), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "H", SHDR_O(h_val), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "octaves", SHDR_O(octaves), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 3, "delta", SHDR_O(delta), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "size", SHDR_O(size), bu_mm_cvt, NULL, NULL },
{"%g", 1, "angle", SHDR_O(max_angle), noise_deg_to_rad, NULL, NULL },
{"%f", 3, "vscale", SHDR_O(vscale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "min", SHDR_O(minval), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
void bu_mm_cvt(const struct bu_structparse *sdp, const char *name, void *base, const char *value, void *data)
Definition: units.c:386
void noise_deg_to_rad(const struct bu_structparse *sdp, const char *name, void *base, const char *value, void *data)
Definition: sh_noise.c:49
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
#define SHDR_O(m)
Definition: sh_noise.c:109
HIDDEN const point_t delta
Definition: sh_prj.c:618

Definition at line 116 of file sh_noise.c.

struct bu_structparse noise_parse_tab[]
Initial value:
= {
{"%p", 1, "noise_print_tab", bu_byteoffset(noise_print_tab[0]), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "lacunarity", SHDR_O(lacunarity), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "l", SHDR_O(lacunarity), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "H", SHDR_O(h_val), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "octaves", SHDR_O(octaves), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "o", SHDR_O(octaves), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 3, "delta", SHDR_O(delta), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 3, "d", SHDR_O(delta), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "size", SHDR_O(size), bu_mm_cvt, NULL, NULL },
{"%g", 1, "s", SHDR_O(size), bu_mm_cvt, NULL, NULL },
{"%g", 1, "angle", SHDR_O(max_angle), noise_deg_to_rad, NULL, NULL },
{"%g", 1, "ang", SHDR_O(max_angle), noise_deg_to_rad, NULL, NULL },
{"%g", 1, "a", SHDR_O(max_angle), noise_deg_to_rad, NULL, NULL },
{"%f", 3, "vscale", SHDR_O(vscale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 3, "vs", SHDR_O(vscale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 3, "v", SHDR_O(vscale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "min", SHDR_O(minval), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
struct bu_structparse noise_print_tab[]
Definition: sh_noise.c:116
#define bu_byteoffset(_i)
Definition: parse.h:81
void bu_mm_cvt(const struct bu_structparse *sdp, const char *name, void *base, const char *value, void *data)
Definition: units.c:386
void noise_deg_to_rad(const struct bu_structparse *sdp, const char *name, void *base, const char *value, void *data)
Definition: sh_noise.c:49
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
#define SHDR_O(m)
Definition: sh_noise.c:109
HIDDEN const point_t delta
Definition: sh_prj.c:618

Definition at line 129 of file sh_noise.c.