test_ssol_materials.h (2802B)
1 /* Copyright (C) 2018-2026 |Meso|Star> (contact@meso-star.com) 2 * Copyright (C) 2016, 2018 CNRS 3 * 4 * This program is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 16 17 #ifndef TEST_SSOL_MATERIALS_H 18 #define TEST_SSOL_MATERIALS_H 19 20 #include <rsys/rsys.h> 21 22 struct ssol_device; 23 24 static INLINE void 25 get_shader_normal 26 (struct ssol_device* dev, 27 struct ssol_param_buffer* buf, 28 const double wavelength, 29 const struct ssol_surface_fragment* frag, 30 double* val) 31 { 32 int i; 33 (void)dev, (void)buf, (void)wavelength; 34 FOR_EACH(i, 0, 3) val[i] = frag->Ns[i]; 35 } 36 37 static INLINE void 38 get_shader_reflectivity 39 (struct ssol_device* dev, 40 struct ssol_param_buffer* buf, 41 const double wavelength, 42 const struct ssol_surface_fragment* frag, 43 double* val) 44 { 45 (void)dev, (void)buf, (void)wavelength, (void)frag; 46 *val = 1; 47 } 48 49 #ifdef REFLECTIVITY 50 static INLINE void 51 get_shader_reflectivity_2 52 (struct ssol_device* dev, 53 struct ssol_param_buffer* buf, 54 const double wavelength, 55 const struct ssol_surface_fragment* frag, 56 double* val) 57 { 58 (void)dev, (void)buf, (void)wavelength, (void)frag; 59 *val = REFLECTIVITY; 60 } 61 #endif 62 63 static INLINE void 64 get_shader_roughness 65 (struct ssol_device* dev, 66 struct ssol_param_buffer* buf, 67 const double wavelength, 68 const struct ssol_surface_fragment* frag, 69 double* val) 70 { 71 (void)dev, (void)buf, (void)wavelength, (void)frag; 72 *val = 0; 73 } 74 75 static INLINE void 76 get_shader_absorption 77 (struct ssol_device* dev, 78 struct ssol_param_buffer* buf, 79 const double wavelength, 80 const struct ssol_surface_fragment* frag, 81 double* val) 82 { 83 (void)dev, (void)buf, (void)wavelength, (void)frag; 84 *val = 0; 85 } 86 87 static INLINE void 88 get_shader_thickness 89 (struct ssol_device* dev, 90 struct ssol_param_buffer* buf, 91 const double wavelength, 92 const struct ssol_surface_fragment* frag, 93 double* val) 94 { 95 (void)dev, (void)buf, (void)wavelength, (void)frag; 96 *val = 1; 97 } 98 99 static INLINE void 100 get_shader_refractive_index 101 (struct ssol_device* dev, 102 struct ssol_param_buffer* buf, 103 const double wavelength, 104 const struct ssol_surface_fragment* frag, 105 double* val) 106 { 107 (void)dev, (void)buf, (void)wavelength, (void)frag; 108 *val = 1.5; 109 } 110 111 #endif /* TEST_SSOL_MATERIALS_H */