Unity, PXCUPipeline.QueryRGB( Texture2D), result is upside-down.

Unity, PXCUPipeline.QueryRGB( Texture2D), result is upside-down.

Has anyone else noticed this?  I am not sure if the overload that takes int[] behaves the same.

I am certain that my object is right-side-up, because other textures show correctly.

I'm currently just rotating the pixels 180 degrees as a fix.  Rotating the object that the texture is applied to is not an option.

My question is, am I doing something wrong or is this just how it is?

Thanks,

Adam

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Which version PerC SDK and Unity are you using? Thanks!

Hi!  Sorry for the delay.

I am using PerC SDK version 13842 (according to Program Files/Intel/PCSDK/release_notes.rtf).  If there is a better place to look let me know :)

Unity version is 4.3.4f1.

Thanks,

Adam

13842 is latest PerC SDK version. Could you provide the related codes you used in the Unity and the screenshot so I can do further investigation? Thanks!

David,

I have attached a zip file with a material and a corresponding texture, which indicate a true-up.

In a vanilla copy of the PCSDK/framework/hellounity project, extract the material and texture I've provided into the assets folder.

Load the project in Unity, and press Play.  Enable Color using the top GUI button.  Observe that the faces on the boxes appear correct-side up.  This is because the boxes are upside-down*.

To verify that the boxes are upside-down (thus making the textures appear correct-side up), switch from the Game view to the Scene view (don't stop the game!).  Drag and drop the provided, unzipped UpMaterial (not the texture) from the Project view, once onto each cube.  This should apply the material to each cube, overriding the use of the Perceptual textures.  Switch back to the Game view, and observe that the text reading "UP" is now upside-down.

UpMaterial and UpTexture are vanilla, and observably right-side up when viewed outside of the game, so the Color/Depth/Label textures must be upside-down.

I think the problem is simple, and this page may be of use, where it says: 

The colors array is a flattened 2D array, where pixels are laid out left to right, bottom to top (i.e. row after row).

Also, please be aware that Unity's primitive cubes have an unintuitive UV mapping, where one face of the cube (on faces with an X/Z orientation) is inverted from the others.

*As an aside, the boxes and camera are all oriented strangely in the scene.  The problem of the textures being upside-down is independent of that; in the context used, I mean they are upside-down relative to the camera).

Thanks for giving this attention!  And sorry if I sound trite, I only mean to be clear.

Adam

Attachments: 

AttachmentSize
Downloadapplication/zip UpMat.zip4.4 KB

Leave a Comment

Please sign in to add a comment. Not a member? Join today