MAC:TGEA 1.8.1: Textures not rendering correctly
by James · in Torque Game Engine Advanced · 05/29/2009 (5:50 am) · 16 replies
This maybe related to the DDS issue but not sure.
When creating a tree with double sided polys turned on for the branches, the texture renders as black.
This appears to be a Mac issue only as the same trees render fine on the Windows side.
Vid Card: NVIDIA GeForce 8800 GS

Edit: Wanted this to be posted in Bug Submissions originally.
When creating a tree with double sided polys turned on for the branches, the texture renders as black.
This appears to be a Mac issue only as the same trees render fine on the Windows side.
Vid Card: NVIDIA GeForce 8800 GS

Edit: Wanted this to be posted in Bug Submissions originally.
#2
When I first encountered the problem however, I used the existing materials.cs and added my tree. It didn't change the results. It was then I noticed the other trees (listed in the material.cs) were also rendering as black. Checking on the Windows side, I realized this appeared to be a problem on the Mac side.
Here is the original materials.cs listing
05/29/2009 (7:41 am)
What you see above does not have a materials.cs set up - neither for the Mac or Windows shots.When I first encountered the problem however, I used the existing materials.cs and added my tree. It didn't change the results. It was then I noticed the other trees (listed in the material.cs) were also rendering as black. Checking on the Windows side, I realized this appeared to be a problem on the Mac side.
Here is the original materials.cs listing
new Material(oak_branch)
{
baseTex[0] = "oak_branch";
translucent = true;
translucentBlendOp = LerpAlpha;
translucentZWrite = true;
alphaRef = 20; // anything below this number is not visible and is not written to zbuffer
};
new Material(shrub)
{
baseTex[0] = "shrub";
translucent = true;
translucentBlendOp = LerpAlpha;
translucentZWrite = true;
alphaRef = 20; // anything below this number is not visible and is not written to zbuffer
};
#3
Here is the materials settings I'm using:
It still appears to be a Mac only issue. The interesting thing is that Todd Picken's trees (winter trees) seem unaffected, so I'm wondering what makes them so different (I'll email you Todd if you see this :) ).
06/04/2009 (3:17 am)
Sorry to bump this again but I've had no luck on my side in solving the "black" texture issue and wondered if anyone can shed some like on this.Here is the materials settings I'm using:
new Material(Tree078)// name of original texture
{
mapTo = "Tree078"; // name of original texture
baseTex[0] = "shrub";// texture to be used
translucent = true;
translucentBlendOp = LerpAlpha;
translucentZWrite = true;
alphaRef = 20; // anything below this number is not visible and is not written to zbuffer
};It still appears to be a Mac only issue. The interesting thing is that Todd Picken's trees (winter trees) seem unaffected, so I'm wondering what makes them so different (I'll email you Todd if you see this :) ).
#4
06/05/2009 (2:59 pm)
What format are the textures?? If they're DDS textures you'll need to have fixed the bug on a mac that makes them render black.
#5
I haven't touch DDS there appeared to be issues there but since the results were similar, I wondered if there might be a connection.
Are there no other Mac users having this problem?
Thanks for the response :)
06/05/2009 (7:07 pm)
They are standard *.png files with an alpha. Both Photoshop and Superpng exports result in the "Black Texture" render, so it appears to be how 2-sided polys are handled on the Mac side.I haven't touch DDS there appeared to be issues there but since the results were similar, I wondered if there might be a connection.
Are there no other Mac users having this problem?
Thanks for the response :)
#6
Nicolas Buquet
www.buquet-net.com/cv/
06/06/2009 (5:25 am)
I had the same results on Mac with TGEA 1.8.1 with trees coming from the racer starter kit from TGE.Nicolas Buquet
www.buquet-net.com/cv/
#7
For resolving DDS textures you need to apply the fix Alex listed in www.garagegames.com/community/forums/viewthread/88187, I'm doubtful it'll help with .png files though but there's always the chance it might.
06/08/2009 (7:11 am)
James - unfortunately not a Mac developer myself but we've got a guy on our team that is and we don't have any issue with using .png files on a mac. For resolving DDS textures you need to apply the fix Alex listed in www.garagegames.com/community/forums/viewthread/88187, I'm doubtful it'll help with .png files though but there's always the chance it might.
#8
I applied the fix you mention above but it hasn't solved the issue.
The problem is easily seen (at least on my end) by placing the stock "shrub" into a scene. The alpha works fine but the texture itself renders black (see image posted above).
Would you mind asking you Mac guy to check that out (the shrub) for me? If it renders fine for him then perhaps it has to do with my graphics card.
Much appreciated.
06/08/2009 (12:12 pm)
Hey Andy. THanks for the response.I applied the fix you mention above but it hasn't solved the issue.
The problem is easily seen (at least on my end) by placing the stock "shrub" into a scene. The alpha works fine but the texture itself renders black (see image posted above).
Would you mind asking you Mac guy to check that out (the shrub) for me? If it renders fine for him then perhaps it has to do with my graphics card.
Much appreciated.
#9
I'd start looking at the glTextureManager.cpp file where it loads textures:
can you step through that in debug or put in some display statements, might also be useful to post your console.log file here in case it shows anything obvious.
06/10/2009 (7:08 am)
He's moving house at the moment but I'll drop him a msg to see if he has a few minutes to have a look at this for ya, we have png textures with alpha layers too and I know he's not had any issues with that.I'd start looking at the glTextureManager.cpp file where it loads textures:
bool GFXGLTextureManager::_loadTexture(GFXTextureObject *aTexture, GBitmap *pDL)
{
GFXGLTextureObject *texture = static_cast<GFXGLTextureObject*>(aTexture);
// No 24bit formats.
if(pDL->getFormat() == GFXFormatR8G8B8)
pDL->setFormat(GFXFormatR8G8B8A8);
// Bind to edit
glActiveTexture(GL_TEXTURE0);
glBindTexture(texture->getBinding(), texture->getHandle());
if(pDL->getFormat() == GFXFormatR8G8B8A8 || pDL->getFormat() == GFXFormatR8G8B8X8)
_fastTextureLoad(texture, pDL);
else
_slowTextureLoad(texture, pDL);
// TODO: When Apple fixes their drivers, remove this.
// On the new iMacs GL_GENERATE_MIPMAP_SGIS does not work when using glTexSubImage, but glGenerateMipmapEXT does.
// In the event that Apple does not fix their drivers, we will specifically test for borked drivers (easy enough) and then
// enable this little workaround. For now though, we rely on GL_EXT_framebuffer_object for generating mipmaps, which is
// NOT GOOD.
if(GFX->getCardProfiler()->queryProfile("GL::Workaround::needsExplicitGenerateMipmap") && texture->mMipLevels != 1 && texture->getBinding() == GL_TEXTURE_2D)
glGenerateMipmapEXT(GL_TEXTURE_2D);
glBindTexture(texture->getBinding(), 0);
return true;
}can you step through that in debug or put in some display statements, might also be useful to post your console.log file here in case it shows anything obvious.
#10
Nicolas, if you get a chance, try the shrub model as well and tell if that results in the same "black texture".
Thanks again :)
06/14/2009 (8:36 am)
Thanks Andy, I'll have a go later this week with the assist of the Tech lead. I've lots of work to do on the project and I'm going to try and find time to set aside to really delve into this.Nicolas, if you get a chance, try the shrub model as well and tell if that results in the same "black texture".
Thanks again :)
#11
06/16/2009 (3:08 am)
James, can you tell me where to find the shrub model ?
#12
Root- Projects/Template/game/scriptsAndAssets/data/trees/
You'll find the shrub.dts there.
06/16/2009 (12:09 pm)
Yes Nicolas, Look here:Root- Projects/Template/game/scriptsAndAssets/data/trees/
You'll find the shrub.dts there.
#13
With the initial trees (treea_1.dts and treea_2.dts) :

With the shrub.dts :


And the same on Windows :
With the initial trees (treea_1.dts and treea_2.dts) :

With the shrub.dts :


Nicolas Buquet
www.buquet-net.com/cv/
06/17/2009 (3:32 am)
Here are the results on Mac : With the initial trees (treea_1.dts and treea_2.dts) :

With the shrub.dts :


And the same on Windows :
With the initial trees (treea_1.dts and treea_2.dts) :

With the shrub.dts :


Nicolas Buquet
www.buquet-net.com/cv/
#14
This is exactly what happens on my maps as well. The alpha and texture are fine until you place them on a 2-side poly, then the texture renders as black.
Thanks Nicolas, appreciate you taking the time to verify this.
06/17/2009 (3:54 am)
Nuts. I was beginning to hope it was just my machine but I guess not.This is exactly what happens on my maps as well. The alpha and texture are fine until you place them on a 2-side poly, then the texture renders as black.
Thanks Nicolas, appreciate you taking the time to verify this.
#15
And I had the same problem with billboards on TGEA 1.8.0/1.8.1, not resolved : www.garagegames.com/community/blogs/view/16325/2#comment-110583
06/17/2009 (4:12 am)
You're welcome James.And I had the same problem with billboards on TGEA 1.8.0/1.8.1, not resolved : www.garagegames.com/community/blogs/view/16325/2#comment-110583
#16
06/18/2009 (6:04 am)
Nicolas, I followed your link and it looks like it maybe the same problem I'm having. My concern is that a number of my models require double sided polys with alpha textures.
Associate Jaimi McEntire
King of Flapjacks