[ios]Object at the back was rendered to the front on device

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
wisp
Gnoblar
Posts: 4
Joined: Thu Nov 28, 2013 1:29 pm

[ios]Object at the back was rendered to the front on device

Post by wisp » Sun Jan 05, 2014 7:55 am

hi,

I created two planes and set glsles shaders that just output a color. But when I moved the camera, some parts of the plane at the back were rendered to the front, just like they were on the same plane, There was enough distance between two planes, and some other objects on the plane had the same situation. This just happened on device.

I've tried to set DepthCheckEnabled to false, that situation didn't happened, but some parts of other object on the plane disappeared.

I'm using OGRE 1.9 , ios7, glsles2.0 and ipad air

Does anyone have an idea?
Thanks in advance!
0 x

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
Contact:

Re: [ios]Object at the back was rendered to the front on dev

Post by masterfalcon » Mon Jan 06, 2014 10:01 am

Could you give some code that replicates the issue? Do you see any errors in the log? Have you tried the same code on a desktop?
0 x

wisp
Gnoblar
Posts: 4
Joined: Thu Nov 28, 2013 1:29 pm

Re: [ios]Object at the back was rendered to the front on dev

Post by wisp » Mon Jan 06, 2014 1:35 pm

Sorry, I can not paste code here for some reason, I use the ogre Xcode 4 templates code, and make some changes, and I'm using Xcode 5. Could you show me some special code I should take care? and i can type my code here.

There is one error about texture in the log.

Error loading texture spheremap.png. Texture layer will be blank.

And I have another problem with running SimpleBrowse. It just shows a black screen. There are some errors in the log like this:

object unsurpported by render system in OffsetMapping.material(35): shader name : Examples/OffsetMappingPSAsm.
Compiler error : unknown error in RTShaderSystem.material(23):token class, rtshader_system, unrecognized.

I don't know whether I have compiled ogre correctly, but my code worked fine with those .a files, except the problem above.

I have not tried the code on a desktop, and I'll try it later. it seems ok on simulator.
0 x

wisp
Gnoblar
Posts: 4
Joined: Thu Nov 28, 2013 1:29 pm

Re: [ios]Object at the back was rendered to the front on dev

Post by wisp » Mon Jan 06, 2014 3:29 pm

I've solved this problem. It's about the shader files.

When I change "precision mediump float" to "precision highp float", it works. But why? Should 64bit system use higher precision?
0 x

User avatar
c6burns
Beholder
Posts: 1511
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines

Re: [ios]Object at the back was rendered to the front on dev

Post by c6burns » Mon Jan 06, 2014 4:16 pm

http://www.khronos.org/registry/gles/sp ... 1.0.17.pdf

Check the section on precision and precision qualifiers. It has nothing to do with your CPU. It's a performance feature to allow you to implement lower precision (and thus better performing) variables in your shaders.
0 x

wisp
Gnoblar
Posts: 4
Joined: Thu Nov 28, 2013 1:29 pm

Re: [ios]Object at the back was rendered to the front on dev

Post by wisp » Tue Jan 07, 2014 3:06 am

I'll read more about it, and thanks, c6burns.
0 x

Post Reply