• Advertisement
Sign in to follow this  

Unity Back/Front faces glitch with 3DS Loader

This topic is 3481 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to compile libpng. But it won't work properly. With the included Makefile & the GNU Compiler /w wxDev-Cpp, all I get is make errors. When I use a Makefile generated by wxDev-Cpp, it compiles, but when I just link against the built library, in the console that shouldn't be there in my 3D app,(which was there before) libpng does some test by reading a png file, then writing it out to another file, then libpng forces the program to exit, certainly not what I want. What do I need to change in the generated Makefile to fix this? Are there any pre-compiled libpng builds, for Windows? How is libpng doing this anyway?(Executing code, when I didn't even use it, just linked against it.) Click here for the 3D problem. [Edited by - yellowstar on July 9, 2008 1:41:14 PM]

Share this post

Link to post
Share on other sites
Now zlib is acting up... It's basicly doing about the same thing as libpng, except now that I get got the console removed, it doesn't say what went wrong. Previously it would do some test, now zlib forces my program to quit when I'm just linking against it, for some reason. And the statically linked libz isn't included in that Win32 download... I'll try it anyway.

That pre-compiled libpng/libz for Win32 worked! At least it didn't force my program to quit anyway.

Share this post

Link to post
Share on other sites
I'm trying to use my code with PNGU. It's made for Nintendo Wii/Gamecube homebrew, but it compiles after fixing some things. For some reason, all I get is a black texture. My .png doesn't have an alpha channel, I don't think. And PNGU doesn't handle RGB directly, it still uses alpha, it just uses a default alpha value. Could somebody post an example on using libpng?(The Wii version of this code works fine, textures-wise.)

unsigned char *LoadTexture(char *filename, GXTexObj *texObj)
int texsize;
int width, height;
unsigned char *texture_data = NULL;
char str[256];
char Str[256];
memset(str, 0, 256);
sprintf(str, "%s", filename);
IMGCTX pngContext;
memset(&pngContext, 0, sizeof(IMGCTX));
memset(&imgProp,0 ,sizeof(PNGUPROP));

if(!(pngContext = PNGU_SelectImageFromDevice(str)))
sprintf(Str, "Failed to open texture %s!",str);;
return NULL;

PNGU_GetImageProperties(pngContext, &imgProp);
width = (int)imgProp.imgWidth;
height = (int)imgProp.imgHeight;
if(width<=0 || height<=0)return NULL;

texsize = (width * height) * 4;
texture_data = (unsigned char*)malloc((size_t)texsize);
if(texture_data==NULL)return NULL;
memset(texture_data, 0, texsize);

PNGU_DecodeToRGBA8(pngContext, (PNGU_u32)width, (PNGU_u32)height, texture_data, 0, 255);
PNGU_ReleaseImageContext (pngContext);

glGenTextures(1, (GLuint*)texObj);
glBindTexture(GL_TEXTURE_2D, *texObj);

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_data);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); // Linear Filtering
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); // Linear Filtering

return texture_data;

I tried a .png with an alpha channel, with the same result.

[Edited by - yellowstar on July 8, 2008 10:39:25 PM]

Share this post

Link to post
Share on other sites
Now that I disable the color gl commands when there's a texture, it works better. The texture shows up at least now. It's worse than the Wii version... But anyway, here's the new problem.(Note that topic is for this problem, for the Wii version, but the same glitch is on this PC version too.)

MOD: Move this topic to the Graphics Programming and Theory section.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Now

  • Advertisement
  • Similar Content

    • By Atwo Studios
      Hey guys,

      Anthony here from Atwo Studios bringing you some new updates for the new year!
      In this video I go over our game ROY, the new games and some general updates to the company!

      If you have not checked out ROY feel free to give it a try! Many people have said they enjoyed the game thus far!
      ROY: https://goo.gl/o6JJ5P
    • By Affgoo
      still a lot of work to do, but its pretty stable  please let me know what you think <3
      Atlas Sentry is a game of destroy everything. Using your turret, simply swivel and shoot your way to victory, upgrading your weapons to unleash destruction on the variety of spaceships. The bigger your combo’s the more score you get! Earn silver as you play and then purchase new weapons and abilities to better deal with your enemy. Different enemies use different tactics and weapons, work out your own priorities in their destruction order. 

      **2 different game modes 
      **A level select mode with 20 difficult levels including a final boss, can you defeat it? **Arcade mode of endless destruction, how long will you last? 
      **High scores to compete against others, see who can take the top spot. 
    • By Chamferbox
      Chamferbox, a mini game asset store has just opened with some nice game assets, 
      Here you can find a free greek statue asset 

      Also check their dragon, zombie dragon and scorpion monster out:

      They're running the Grand Opening Sale, it's 30% off for all items, but for gamedev member, you can use this coupon code:
      to get 50% off prices What are you waiting for, go to
      and get those models now!

      View full story
    • By Dafu
      FES Retro Game Framework is now available on the Unity Asset Store for your kind consideration!
      FES was born when I set out to start a retro pixel game project. I was looking around for an engine to try next. I tried a number of things, from GameMaker, to Fantasy Consoles, to MonoGame and Godot and then ended up back at Unity. Unity is just unbeatable in it's cross-platform support, and ease of deployment, but it sure as heck gets in the way of proper retro pixel games!
      So I poured over the Unity pipeline and found the lowest levels I could tie into and bring up a new retro game engine inside of Unity, but with a completely different source-code-only, classic game-loop retro blitting and bleeping API. Months of polishing and tweaking later I ended up with FES.
      Some FES features:
      Pixel perfect rendering RGB and Indexed color mode, with palette swapping support Primitive shape rendering, lines, rectangles, ellipses, pixels Multi-layered tilemaps with TMX file support Offscreen rendering Text rendering, with text alignment, overflow settings, and custom pixel font support Clipping Sound and Music APIs Simplified Input handling Wide pixel support (think Atari 2600) Post processing and transition effects, such as scanlines, screen wipes, screen shake, fade, pixelate and more Deploy to all Unity supported platforms I've put in lots of hours into a very detail documentation, you can flip through it here to get an better glimpse at the features and general overview: http://www.pixeltrollgames.com/fes/docs/index.html
      FES is carefully designed and well optimized (see live stress test demo below). Internally it uses batching, it chunks tilemaps, is careful about memory allocations, and tries to be smart about any heavy operations.
      Please have a quick look at the screenshots and live demos below and let me know what you think! I'd love to hear some opinions, feedback and questions!
      I hope I've tickled your retro feels!

      More images at: https://imgur.com/a/LFMAc
      Live demo feature reel: https://simmer.io/@Dafu/fes
      Live blitting stress test: https://simmer.io/@Dafu/fes-drawstress
      Unity Asset Store: https://www.assetstore.unity3d.com/#!/content/102064

      View full story
    • By DevdogUnity

      Ho ho ho
      Tis the season of Christmas surprises, and we have a awesome one for you! 🎅  
      Sponsored by all your favorite Unity Asset Store developers, Nordic Game Jam, Pocket Gamer Connects, and co-hosted by Game Analytics, we (Joris and I – Devdog) are launching the second edition of our yearly Christmas Giveaway Calendar for all Unity game developers!
      You can already now sign up right here.
      So what’s this all about?
      For the past weeks, we’ve been collecting sponsored gifts related to Unity (asset vouchers, product keys, conference tickets etc.), and throughout each day of December leading up to Christmas Day on the 25th, we will be sending out these sponsored gifts as early gamedev Christmas presents via e-mail to hundreds of lucky winners.
      The total prize pool is at $35,000, with over 1200 presents donated by the awesome sponsors!
      Merry Christmas from Devdog, Game Analytics, and every single one of the sponsors.

      View full story
  • Advertisement