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

Go to the source code of this file.

Data Structures

struct  cloud_specific
 

Macros

#define CL_NULL   ((struct cloud_specific *)0)
 
#define CL_O(m)   bu_offsetof(struct cloud_specific, m)
 
#define TWO_PI_OVER_PI_OVER_TWO   4
 

Functions

HIDDEN int cloud_setup (register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
 
HIDDEN int cloud_render (struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
 
HIDDEN void cloud_print (register struct region *rp, void *dp)
 
HIDDEN void cloud_free (void *cp)
 
double cloud_texture (register fastf_t x, register fastf_t y, fastf_t Contrast, fastf_t initFx, fastf_t initFy)
 

Variables

struct bu_structparse cloud_parse []
 
struct mfuncs cloud_mfuncs []
 

Detailed Description

An attempt at 2D Geoffrey Gardner style cloud texture map

Definition in file sh_cloud.c.

Macro Definition Documentation

#define CL_NULL   ((struct cloud_specific *)0)

Definition at line 40 of file sh_cloud.c.

#define CL_O (   m)    bu_offsetof(struct cloud_specific, m)

Definition at line 41 of file sh_cloud.c.

#define TWO_PI_OVER_PI_OVER_TWO   4

Referenced by cloud_texture().

Function Documentation

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

Definition at line 137 of file sh_cloud.c.

References BU_CK_VLS, BU_GET, bu_struct_parse(), cloud_specific::cl_range, and cloud_specific::cl_thresh.

Here is the call graph for this function:

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

Definition at line 176 of file sh_cloud.c.

References cloud_specific::cl_range, cloud_specific::cl_thresh, cloud_texture(), and if().

Here is the call graph for this function:

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

Definition at line 155 of file sh_cloud.c.

References bu_struct_print(), and region::reg_name.

Here is the call graph for this function:

HIDDEN void cloud_free ( void *  cp)

Definition at line 162 of file sh_cloud.c.

References BU_PUT.

double cloud_texture ( register fastf_t  x,
register fastf_t  y,
fastf_t  Contrast,
fastf_t  initFx,
fastf_t  initFy 
)

Definition at line 68 of file sh_cloud.c.

References bn_tab_sin, C, M_SQRT1_2, and TWO_PI_OVER_PI_OVER_TWO.

Referenced by cloud_render().

Variable Documentation

struct bu_structparse cloud_parse[]
Initial value:
= {
{"%f", 1, "thresh", CL_O(cl_thresh), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 1, "range", CL_O(cl_range), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
#define CL_O(m)
Definition: sh_cloud.c:41
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153

Definition at line 43 of file sh_cloud.c.

struct mfuncs cloud_mfuncs[]
Initial value:
= {
{MF_MAGIC, "cloud", 0, MFI_UV, 0,
{0, (char *)0, 0, 0, 0,
0, 0, 0, 0 }
}
#define MF_MAGIC
Definition: magic.h:205
HIDDEN int cloud_setup(register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
Definition: sh_cloud.c:137
HIDDEN void cloud_free(void *cp)
Definition: sh_cloud.c:162
HIDDEN void cloud_print(register struct region *rp, void *dp)
Definition: sh_cloud.c:155
HIDDEN int cloud_render(struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
Definition: sh_cloud.c:176

Definition at line 55 of file sh_cloud.c.

Referenced by optical_shader_init().