RT
render.h
Go to the documentation of this file.
1 /* ************************************************************************** */
2 /* */
3 /* ::: :::::::: */
4 /* render.h :+: :+: :+: */
5 /* +:+ +:+ +:+ */
6 /* By: sklepper <sklepper@student.42.fr> +#+ +:+ +#+ */
7 /* +#+#+#+#+#+ +#+ */
8 /* Created: 2019/06/24 14:50:27 by nihuynh #+# #+# */
9 /* Updated: 2019/07/11 12:45:57 by sklepper ### ########.fr */
10 /* */
11 /* ************************************************************************** */
12 
13 #ifndef RENDER_H
14 # define RENDER_H
15 
16 # include "rtstruct.h"
17 # include "color.h"
18 # include "t_data.h"
19 
20 /*
21 ** Render :
22 */
23 
24 # define DIFFUSE 0
25 # define SPECULAR 1
26 
27 # define REFLECT 0
28 # define REFRACT 1
29 
31 void render_gui(void *arg);
33 void cast_primary(t_list *obj_list, t_inter *inter);
34 t_color recursive_cast(t_scene scene, t_settings s, t_ray r, int depth);
35 void set_direction(t_cam *cam, t_vec3 direction);
36 void cam_ray(t_data *app, t_ray *res, float x, float y);
37 t_color cast_light_primary(t_list *obj_list, t_inter *inter,
38  float dist_light);
40 t_color get_sky_color(t_scene scene, t_settings settings, t_ray ray);
41 float get_distance_attenuation(float distance);
42 void add_specular_light(t_color *specular, t_shading shading,
43  bool no_specular);
44 void add_diffuse_light(t_color *diffuse, t_shading shading,
45  bool no_diffuse);
46 
47 void update_camera(t_cam *cam, bool *needs_render);
48 
49 /*
50 ** Textures :
51 */
52 
53 typedef struct s_tex_proced
54 {
55  char *name;
57 } t_tex_proced;
58 
66 t_color sample(t_material *material, t_texture *tex, t_vec3 uv);
67 
68 /*
69 ** Perlin :
70 */
71 
72 float noise(float x, float y, float z);
73 float perlin(t_vec3 uv, int octaves, float persistence);
74 
75 /*
76 ** Post-process :
77 */
78 t_color anti_aliasing(t_color col_prim, t_data *app, int x, int y);
83 
84 #endif
s_ray
Definition: rtstruct.h:44
s_cam
Definition: rtstruct.h:130
add_diffuse_light
void add_diffuse_light(t_color *diffuse, t_shading shading, bool no_diffuse)
Definition: light_utils.c:60
s_vec3
Definition: rtstruct.h:30
s_settings
Definition: t_settings.h:19
grayscale
t_color grayscale(t_color in)
Definition: post_process.c:27
t_tex_proced
struct s_tex_proced t_tex_proced
set_direction
void set_direction(t_cam *cam, t_vec3 direction)
Definition: camera.c:101
compute_shading_normal
t_vec3 compute_shading_normal(t_material mat, t_vec3 uv, t_vec3 geo_n)
Definition: normal_mapping.c:38
texture_checkers
t_color texture_checkers(t_material *mat, t_texture *tex, t_vec3 uv)
Definition: perturbation.c:34
texture_strips
t_color texture_strips(t_material *mat, t_texture *tex, t_vec3 uv)
Definition: perturbation.c:20
texture_perlin
t_color texture_perlin(t_material *mat, t_texture *tex, t_vec3 uv)
Definition: perlin_texture.c:17
s_tex_proced::f_texture
t_color(* f_texture)(t_material *, t_texture *, t_vec3)
Definition: render.h:56
get_sky_color
t_color get_sky_color(t_scene scene, t_settings settings, t_ray ray)
Definition: skybox.c:16
texture_cloud
t_color texture_cloud(t_material *mat, t_texture *tex, t_vec3 uv)
Definition: perlin_texture.c:56
s_material
Definition: rtstruct.h:189
s_color
Definition: color.h:23
recursive_cast
t_color recursive_cast(t_scene scene, t_settings s, t_ray r, int depth)
Definition: render.c:68
s_shading
Definition: rtstruct.h:263
anti_aliasing
t_color anti_aliasing(t_color col_prim, t_data *app, int x, int y)
Definition: filters.c:16
s_tex_proced::name
char * name
Definition: render.h:55
render_gui
void render_gui(void *arg)
Definition: update.c:33
perlin
float perlin(t_vec3 uv, int octaves, float persistence)
Definition: perlin.c:86
sample
t_color sample(t_material *material, t_texture *tex, t_vec3 uv)
Definition: perturbation.c:60
negative
t_color negative(t_color in)
Definition: post_process.c:47
s_texture
Definition: rtstruct.h:166
get_lighting
t_color get_lighting(t_shading s, t_scene scene, t_settings *setng)
Definition: light.c:62
add_specular_light
void add_specular_light(t_color *specular, t_shading shading, bool no_specular)
Definition: light_utils.c:39
texture_marble
t_color texture_marble(t_material *mat, t_texture *tex, t_vec3 uv)
Definition: perlin_texture.c:44
cast_primary
void cast_primary(t_list *obj_list, t_inter *inter)
Definition: cast.c:19
rtstruct.h
s_data
Definition: t_data.h:24
s_tex_proced
Definition: render.h:53
get_shading_data
t_shading get_shading_data(t_inter *inter)
Definition: render.c:90
t_vec3
struct s_vec3 t_vec3
cartoon
t_color cartoon(t_color in)
Definition: post_process.c:37
sepia
t_color sepia(t_color in)
Definition: post_process.c:17
get_distance_attenuation
float get_distance_attenuation(float distance)
Definition: light_utils.c:17
cast_light_primary
t_color cast_light_primary(t_list *obj_list, t_inter *inter, float dist_light)
Definition: cast.c:58
s_inter
Definition: rtstruct.h:218
noise
float noise(float x, float y, float z)
Definition: perlin.c:61
color.h
s_scene
Definition: t_scene.h:18
t_data.h
cam_ray
void cam_ray(t_data *app, t_ray *res, float x, float y)
Definition: render.c:20
texture_wood
t_color texture_wood(t_material *mat, t_texture *tex, t_vec3 uv)
Definition: perlin_texture.c:30
update_camera
void update_camera(t_cam *cam, bool *needs_render)
Definition: camera.c:77
t_color
struct s_color t_color
texture_wave
t_color texture_wave(t_material *mat, t_texture *tex, t_vec3 uv)
Definition: perturbation.c:50