cinetec_tech Posted July 6, 2016 Posted July 6, 2016 hi: When you use grabber to capture a cubemap or 2d image in hdr mode, you get a rgba16f. Now i want to read that image value use image.getCube() / image.get2D(); You can't read that image as it's not supported. Hope this could be fixed as rgba16f is quit common now thanks
silent Posted July 8, 2016 Posted July 8, 2016 Hi Cinetec. getCube() and get2D() methods returning Unigine::Pixel as union output. You can read pixel as float or as int using f or i postfixes. For example: Unigine::Pixel pixel = getCube(...) float r_channel = pixel.f.r; Have you tried this approach?Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
cinetec_tech Posted July 8, 2016 Author Posted July 8, 2016 case FORMAT_RGBA16F: { unsigned short *d = (unsigned short*)&data[id * 8]; p.i.r = *(d + 0); p.i.g = *(d + 1); p.i.b = *(d + 2); p.i.a = *(d + 3); return; } should it be p.f.r=*(d+0);? since it's float
silent Posted July 11, 2016 Posted July 11, 2016 Hi Cinetec, There is no error in case of RGBA16F format. Engine store pixel values inside i because there is no special half type in C++ (actually, inside each pixel a bit representation of half type is stored). That's why that part of code was written. Later you can access pixel values via f union for more convenience. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts