1

I'm facing hard times trying to get the texture to work in Cocos3D. Here's what I've done.

STEP 1: Via MakeHuman, I created a male model with materials that includes jeans, hair and Tshirt.

STEP 2: I exported the Blender Exchange Tarzen.mhx file that include texture images.

STEP 3: Via Blender, I imported the Tarzen.mhx file and saved this workspace in the same directory as the texture images as Tarzen.blend. That allowed the Tarzen.pod file to symbolically points to the texture images path relatively.

STEP 4: Without any further changes to Blender, I exported the Tarzen.pod file. PVRShaman displays the model with all textures correctly.

STEP 5: I copied the Tarzen.pod and all texture images into xCode's resource folder and execute the code. Interestingly, only the skin color and hair color looks correctly but the jeans and TShirt always show up black.

Any idea why? Thanks.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
Loc Pham
  • 619
  • 1
  • 6
  • 18
  • This question is better suited for http://gamedev.stackexchange.com as on SO the focus is on programming tasks/issues. – CodeSmile Dec 05 '14 at 15:57
  • I posted this question on games.stackoverflow and it's place on hold as off topic. Humm http://gamedev.stackexchange.com/questions/88226/cocos3d-texture-not-shown – Loc Pham Dec 06 '14 at 03:15
  • If PVRShaman is showing this correctly, it may be an issue with your Cocos3D setup. Sometimes the POD is exported with opacity turned off, so try including myModel.opacity = kCCOpacityFull; after loading it. If you are still having an issue, ZIP a simple Xcode project that demos it (or just your POD model and textures), email it to support@brenwill.com, and I'll have look at it. – Bill Hollings Dec 06 '14 at 12:39
  • Bill, I have kCCOpacityFull set but the texture still doesn't show up. I've sent you an email at brenwill. I greatly appreciate your help as I've been stuck for over a day now. Thanks. – Loc Pham Dec 06 '14 at 17:42
  • In addition sending the xCode project to support@brenwill, I also placed a copy of it here. Thanks. https://dl.dropboxusercontent.com/u/66024121/iOS/Cocos3dTexture/EmbedInUIView.zip – Loc Pham Dec 07 '14 at 02:12
  • Problem resolved, please see the accepted answer below. – Loc Pham Dec 07 '14 at 17:10

1 Answers1

0

"Without The" helped me resolved this issue by first remove the texture then added back in using the following code:

CC3MeshNode * jeans = [rezNode getMeshNodeNamed:@"Bison:jeans01"];
[jeans.material removeAllTextures];
[jeans.material addTexture:[CC3Texture textureFromFile:@"jeans_basic_diffuse.png"]];
Loc Pham
  • 619
  • 1
  • 6
  • 18
  • I'm glad you got it sorted out. Your jeans material has two textures, one being a normal map. But your mesh contains no vertex tangents, which gives the shaders nothing to use on the normal map. By removing the normal map texture, as you do here, you just display the jean color texture. You could also modify the shaders to adapt to your original conditions. – Bill Hollings Dec 08 '14 at 14:19