-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Converting IES file to intensityDistribution parameter #582
Comments
OSPRay Studio can load EULUMDAT files (alternative file format to IES, there are many converter tools) and pass the data as |
If IES is the necessary file format, there is a simple header-only IES file loader https://github.com/fknfilewalker/tinyies that will parse the file into an intensity array, and then the code that @johguenther mentions above can help to create the OSPRay |
Thanks for the answers, it helped a lot. We have another question about the converter: We implemented your suggestions, but the results are incorrect. ['A' image] Code: phy_light = ospNewLight("spot");
CALVector3 pos = from; // float[3]
ospSetParam(phy_light, "position", OSP_VEC3F, pos);
CALVector3 t_ = To; // float[3]
t_.normalize();
ospSetParam(phy_light, "direction", OSP_VEC3F, t_);
OSPIntensityQuantity INTq = OSPIntensityQuantity::OSP_INTENSITY_QUANTITY_SCALE;
ospSetInt(phy_light, "intensityQuantity", INTq);
//ospSetParam(phy_light, "intensityQuantity", OSP_UINT, &INTq);
//ospSetParam(phy_light, "intensityQuantity", OSP_UCHAR, &INTq);
// CALVector3 c0(0, 0, 1);
// ospSetParam(phy_light, "c0", OSP_VEC3F, c0);
OSPData data_;
ospray::sg::Eulumdat lamp(R"(C:\......................\A.ldt)");
lamp.load();
float *pmData = new float[lamp.lid.size()];
for( int x = 0; x < lamp.lid.size(); x++)
pmData[x] = lamp.lid[x];
data_ = ospNewSharedData1D(pmData, OSP_FLOAT, lamp.lid.size());
ospSetObject(phy_light, "intensityDistribution", data_);
ospCommit(phy_light); I attached 3 pictures of the result. What can you suggest to make the final result of the IES lights good? |
The IES data you use is 2D, but passed as 1D, thus what you see is the different slices/planes compressed within the illumination cone (showing as stripes). Try changing to data_ = ospNewSharedData2D(lamp.lid.data(), OSP_FLOAT, lamp.Ng, lamp.totalMc) No need to copy the data into |
Hi,
We are stuck with converting the IES files to intensityDistribution parameter. Can someone please send me an example how to do it?
We checked the https://www.ospray.org/documentation.html#photometric-lights document and found some information in Table 24, but couldn't figure out the conversion number.
The text was updated successfully, but these errors were encountered: