Avokadoen / tdt4230_project_raytracing

My TDT4230 project submition, a GPGPU voxel ray tracer!
5 stars 0 forks source link

refactor materials memory layout #3

Closed Avokadoen closed 3 years ago

Avokadoen commented 3 years ago

Hittable i.e sphere can't have int types in struct. Maybe it can be coerced but the source bits will still be float in rust, but they should have a (float) index to a material in a separate buffer. Each material should hold three things: MaterialType (int), material attributes index and albedo index Then each material type should have it's own buffer of attributes data i.e metal has the fuzzing and the attribute index will be relative to the context it is used. So in scatter_metalic we know the index is to the metalic buffer etc.

This change will simplify the code as the requirements grow and avoid padding