-
Notifications
You must be signed in to change notification settings - Fork 52
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
Undocumented restriction on camera width values #945
Comments
Interesting, I suppose this is something that doesn't come up often. I imagine it's a requirement from the underlying rendering engine. Are you using @darksylinc are ogre-next render targets restricted to some set of resolutions? |
It apears on both Ogre and Ogre2. Camera sensor example world with
I haven't been able to reproduce this for a width value that is divisible by four. |
No, they are not. This sounds like some silly bug when Gazebo is downloading from GPU to CPU. Usually mistaken pitch with width. e.g. pixels[y * width + x];
// vs
pixels[y * texBox.bytesPerRow + x]; OgreNext enforces an alignment of 4 bytes for texture data, so if this if an R8 or R16 greyscale texture, it could be easily explained by that. e.g. a 3x2 R8_UNORM texture will have the following layout in memory:
Where P is padding so that y = 1 starts at an address multiple of 4 bytes. More examples:
RGBA8_UNORM will never exhibit this issue because each pixel being 4 bytes in size means that all pixels are naturally aligned to 4 bytes regardless of resolution. Note that the opposite may be happening: Gazebo makes a lot of (redundant) copies, and it no longer requires pitch (because Gazebo tightly packed them together), but it is now using an old pitch to read it. |
fixed by gazebosim/gz-gui#602 |
Environment
gz-rendering8
build from sourceDescription
A camera sensor allows only specific
<width>
values.On first sight it seems that the horizontal resolution must be a multiple of 4.
E.g. in the camera_sensor example world, changing
<width>1280</width>
into<width>1281</width>
yields a garbled image.There does not seem to be a similar restriction for the
<height>
value.I don't think this is an issue in real life, as upon quick look I did not find any cameras with horizontal resolution undivisible by four. (I did find some with vertical resolution undivisible by four, but that is supported).
Nevertheless, if this is a requirement, it might be valuable to add an error message upon specification of an incompatible horizontal resolution.
The text was updated successfully, but these errors were encountered: