RTCSETGEOMETRYINSTANCEDSCENES(3)

πŸ“¦
version 4.4.1 Β· 3 versions
, in ubuntu stonking

✨ NAME ✨

rtcSetGeometryInstancedScenes β€” bestie, this one sets up a whole array of scenes that your instance array geometry can go and instance πŸ’–


🌸 SYNOPSIS 🌸

#include <embree4/rtcore.h>

void rtcSetGeometryInstancedScenes(
  RTCGeometry geometry,
  RTCScene* scene,
  size_t numScenes
);

πŸŽ€ DESCRIPTION πŸŽ€

okay so. rtcSetGeometryInstancedScenes takes an array of type RTCScene β€” with numScenes elements in it β€” and hands it to the instance geometry you passed in as the geometry argument, so that geometry can instance any of them. it's giving options, and honestly? iconic.

but wait, there's more, and it's not optional πŸ™ˆ β€” this call also needs you to set an index buffer, using either rtcSetSharedGeometryBuffer or rtcSetNewGeometryBuffer. literally same energy as index buffers for triangle meshes. and what does that index buffer do? it says which instance of the instance array instances which scene in the scene array. yes bestie, that's the whole vibe: instance ➑️ scene, mapped out by the index buffer. slay.

πŸ’‘ tiny note from your girl: if you've only got one scene you wanna instance, don't do all this. use rtcSetGeometryInstancedScene instead β€” it's the preferred move. no cap.

πŸ’€ EXIT STATUS πŸ’€

if it fails? an error code gets set, and you can go query it with rtcGetDeviceError. so like, check that. fr fr. 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

  • RTC_GEOMETRY_TYPE_INSTANCE_ARRAY
  • rtcSetNewGeometryBuffer
  • rtcSetSharedGeometryBuffer
  • rtcSetGeometryInstancedScene

and that's the whole page, bestie πŸ’… this was Embree Ray Tracing Kernels 4 doing the absolute most, and the rtcSetGeo...ncedScenes(3) energy is immaculate. go forth and instance responsibly πŸ¦‹βœ¨

πŸ“¦ where this page comes from