RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1.01k stars 182 forks source link

Setting texture dimensions using c interface #473

Closed hieronymusanthonius closed 3 years ago

hieronymusanthonius commented 3 years ago

I got ospray running in a UWP app with a few issues. I am using the c interface and I cannot figure out how to set the texture dimensions ? Anybody a hint please?

johguenther commented 3 years ago

Texture dimensions are inferred from the data array, thus for textures use a 2D array with the dimensions of the texture image:

OSPData data = ospNewSharedData(texturePtr, type, width, 0, height);

"Type" should be a compatible type to the texture format, e.g. OSP_VEC4UC for OSP_TEXTURE_SRGBA.

johguenther commented 3 years ago

Please reopen if you have further questions.