Jump to content

image RGBA16F issue


photo

Recommended Posts

Posted

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

Posted

Hi Cinetec.

 

getCube() and get2D() methods returning Unigine::Pixel as union output. You can read pixel as float or as int using or 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:

Posted
		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 

Posted

Hi Cinetec,

 

There is no error in case of RGBA16F format.

 

Engine store pixel values inside 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 union for more convenience.

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

×
×
  • Create New...