Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Textures printed in Back Face, Front Face transparent and UV maps


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 babarorhum   Members   -  Reputation: 100

Like
0Likes
Like

Posted 10 February 2012 - 06:28 PM

Hello everyone,

In a nutshell, i am using Blender 3D to export a cube with an associated UV map for texture three faces.
I have managed to bring up textures on a cube in OpenGL ES for learning how to apply textures.
However the result i get is the following:
  • front face of the cube appears transparent
  • textures are visible in the back face (inside the cube)
  • and faces which are not in the UV map they simply appear black.
Do you know how to proceed to have the textures shown in the front faces and seeing these faces which are not subject to the UV map ?

Many thanks in advance ! Posted Image
Cheers,
Stéphane
ps. attached screenshot to be more visual

Attached Thumbnails

  • Screenshot BackFace Textured.png


Sponsor:

#2 babarorhum   Members   -  Reputation: 100

Like
0Likes
Like

Posted 11 February 2012 - 02:27 PM

Problem Solved. I have added the following lines in my setupview :

glEnable(GL_CULL_FACE);

glCullFace(GL_FRONT);


and also changed in DrawArrays from GL_TRIANGE_STRIP to GL_TRIANGLES. Work perfectly now Posted Image


Cheers,

Stéphane


#3 karwosts   Members   -  Reputation: 840

Like
0Likes
Like

Posted 12 February 2012 - 10:57 PM

A better solution would probably be to export the model with the faces going in the correct direction. Sounds like your model is wound backwards. I think this will give you problems later if you try to mess with lighting and normal vectors, as they are probably pointing in the wrong direction.

Exactly how to do this depends on the Blender version, but you probably want to look for something similar to "Flip Faces" or "Flip Normals".

Your solution may work for now, but it seems kind of backwards. Its not typical to render a model with front faces disabled (back faces disabled is more normal).
My Projects:
Portfolio Map for Android - Free Visual Portfolio Tracker
Electron Flux for Android - Free Puzzle/Logic Game

#4 dpadam450   Members   -  Reputation: 949

Like
0Likes
Like

Posted 13 February 2012 - 04:29 PM

Yea, basically you fixed it but its not proper and could lead to problems in certain shaders like when generating specular with relfecting vectors (not entirely sure). But you should be exporting the normals from Blender as well, because once you have smooth models like a sphere, each vertex will need a specific normal that you will need to export.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS