BRL-CAD
sh_scloud.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 "light.h"
Include dependency graph for sh_scloud.c:

Go to the source code of this file.

Data Structures

struct  scloud_specific
 

Macros

#define FLOOR(x)   ((int)(x) - ((x) < 0 && (x) != (int)(x)))
 
#define CEIL(x)   ((int)(x) + ((x) > 0 && (x) != (int)(x)))
 
#define SHDR_NULL   ((struct scloud_specific *)0)
 
#define SHDR_O(m)   bu_offsetof(struct scloud_specific, m)
 

Functions

HIDDEN int scloud_setup (register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
 
HIDDEN int scloud_render (struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
 
HIDDEN int tsplat_render (struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
 
HIDDEN void scloud_print (register struct region *rp, void *dp)
 
HIDDEN void scloud_free (void *cp)
 

Variables

struct bu_structparse scloud_pr []
 
struct bu_structparse scloud_parse []
 
struct mfuncs scloud_mfuncs []
 

Detailed Description

A 3D "solid" cloud shader

Definition in file sh_scloud.c.

Macro Definition Documentation

#define FLOOR (   x)    ((int)(x) - ((x) < 0 && (x) != (int)(x)))

Definition at line 39 of file sh_scloud.c.

#define CEIL (   x)    ((int)(x) + ((x) > 0 && (x) != (int)(x)))

Definition at line 40 of file sh_scloud.c.

#define SHDR_NULL   ((struct scloud_specific *)0)

Definition at line 70 of file sh_scloud.c.

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

Definition at line 71 of file sh_scloud.c.

Function Documentation

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

Definition at line 117 of file sh_scloud.c.

References bn_mat_inv(), bn_mat_mul(), bn_mat_mul2(), bu_bomb(), BU_CK_VLS, BU_GET, bu_log(), bu_struct_parse(), bu_struct_print(), db_path_to_mat(), db_string_to_path(), scloud_specific::delta, scloud_specific::mtos, rdebug, RDEBUG_SHADE, region::reg_aircode, region::reg_name, rt_uniresource, rt_i::rti_dbip, scloud_specific::scale, scloud_specific::stom, and scloud_specific::vscale.

Here is the call graph for this function:

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

Definition at line 208 of file sh_scloud.c.

References bn_noise_fbm(), scloud_specific::h_val, scloud_specific::lacunarity, scloud_specific::mtos, scloud_specific::octaves, partition::pt_regionp, rr_render(), RT_AP_CHECK, RT_CHECK_PT, and RT_CK_REGION.

Here is the call graph for this function:

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

Definition at line 190 of file sh_scloud.c.

References bu_struct_print(), and region::reg_name.

Here is the call graph for this function:

HIDDEN void scloud_free ( void *  cp)

Definition at line 197 of file sh_scloud.c.

References BU_PUT.

Variable Documentation

struct bu_structparse scloud_pr[]
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 },
{"%g", 1, "scale", SHDR_O(scale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 3, "vscale", SHDR_O(vscale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 3, "delta", SHDR_O(delta), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "Max", SHDR_O(max_d_p_mm), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "min", SHDR_O(min_d_p_mm), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
#define SHDR_O(m)
Definition: sh_scloud.c:71
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
HIDDEN const point_t delta
Definition: sh_prj.c:618

Definition at line 73 of file sh_scloud.c.

struct bu_structparse scloud_parse[]
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 },
{"%g", 1, "scale", SHDR_O(scale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 3, "delta", SHDR_O(delta), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "l", SHDR_O(lacunarity), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "M", SHDR_O(max_d_p_mm), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "Max", SHDR_O(max_d_p_mm), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "m", SHDR_O(min_d_p_mm), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "min", SHDR_O(min_d_p_mm), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "o", SHDR_O(octaves), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "s", SHDR_O(scale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 3, "vs", SHDR_O(vscale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 3, "d", SHDR_O(delta), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
#define SHDR_O(m)
Definition: sh_scloud.c:71
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
HIDDEN const point_t delta
Definition: sh_prj.c:618

Definition at line 84 of file sh_scloud.c.

struct mfuncs scloud_mfuncs[]
Initial value:
= {
{MF_MAGIC, "scloud", 0, MFI_HIT, MFF_PROC, scloud_setup, scloud_render, scloud_print, scloud_free },
{MF_MAGIC, "tsplat", 0, MFI_HIT, MFF_PROC, scloud_setup, tsplat_render, scloud_print, scloud_free },
{0, (char *)0, 0, 0, 0, 0, 0, 0, 0 }
}
#define MF_MAGIC
Definition: magic.h:205
HIDDEN int scloud_setup(register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
Definition: sh_scloud.c:117
HIDDEN int scloud_render(struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
Definition: sh_scloud.c:236
HIDDEN void scloud_free(void *cp)
Definition: sh_scloud.c:197
HIDDEN int tsplat_render(struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
Definition: sh_scloud.c:208
HIDDEN void scloud_print(register struct region *rp, void *dp)
Definition: sh_scloud.c:190

Definition at line 109 of file sh_scloud.c.

Referenced by optical_shader_init().