Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5225 | alpine | 1 | #ifndef RS_GTX_H |
2 | #define RS_GTX_H |
||
3 | |||
4 | #include "rsgame.h" |
||
5 | |||
6 | /* |
||
7 | |||
8 | Procedural Texture Generator |
||
9 | by Roman Shuvalov |
||
10 | |||
11 | */ |
||
12 | |||
13 | //void rs_model_create_pyramid(rs_vbo_t* vbo); |
||
14 | |||
15 | void generate_perlin_tex(); |
||
16 | |||
17 | typedef struct rs_gen_reg_t { |
||
18 | int tex_size; |
||
19 | int tex_length; // tex_size*tex_size |
||
20 | int tex_count; |
||
21 | float cell_scale; |
||
22 | float *tex; |
||
23 | unsigned char *tex_out; |
||
24 | } rs_gen_reg_t; |
||
25 | |||
26 | extern rs_gen_reg_t rs_gen_reg; |
||
27 | |||
28 | void rs_gen_init(int tex_count, int tex_size); |
||
29 | |||
30 | void rs_gen_tex_out(int tex, int bpp); |
||
31 | void rs_gen_tex_out_rgb_set(float r, float g, float b); |
||
32 | void rs_gen_tex_out_rgb(int tex_r, int tex_g, int tex_b, float kr, float kg, float kb); |
||
33 | void rs_gen_tex_out_rgba_set(float r, float g, float b, float a); |
||
34 | void rs_gen_tex_out_rgba(int tex_r, int tex_g, int tex_b, int tex_a, float kr, float kg, float kb, float ka); |
||
35 | |||
36 | |||
37 | void rs_gen_term(); |
||
38 | |||
39 | void rs_gen_func_mult_add_value(int dest, int src, float val_mult, float val_add); |
||
40 | void rs_gen_func_perlin(int dest, float freq, int octaves, float persistence, float seed); |
||
41 | void rs_gen_func_quads(int dest, float freq, int octaves, float persistence, float seed); |
||
42 | void rs_gen_func_radial(int dest, float x, float y, float radius, float v, float power); |
||
43 | void rs_gen_func_gradient_v(int dest, float v, float power); |
||
44 | void rs_gen_func_add(int dest, int src1, int src2, float k1, float k2); |
||
45 | void rs_gen_func_add_lerped(int dest, int src1, int src2, float k1, float k2); |
||
46 | void rs_gen_func_normalize(int dest, float vmin, float vmax); |
||
47 | void rs_gen_func_clamp(int dest, float vmin, float vmax); |
||
48 | void rs_gen_func_lerp_parametric(int dest, int src1, int src2, int param); |
||
49 | void rs_gen_func_mult(int dest, int src1, int src2); |
||
50 | void rs_gen_func_set(int dest, float val); |
||
51 | void rs_gen_func_noise(int dest, int seed); |
||
52 | void rs_gen_func_cell(int dest, int seed, int num_points, signed short *p, float k1, float pow1, float k2, float pow2, float k3, float pow3); |
||
53 | void rs_gen_func_adr(int dest, int src, int adr_x, int adr_y, float src_factor, float adr_factor); |
||
54 | void rs_gen_func_normalmap(int dest_r, int dest_g, int dest_b, int src, float k); |
||
55 | |||
56 | void rs_gen_func_apply_mask(int dest, unsigned char *mask_data); |
||
57 | void rs_gen_func_posterize(int dest, int colors_count); |
||
58 | |||
59 | |||
60 | #endif |