gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Another Day, A new Texture Quadratic Demo

#41246 - Ethos - Tue Apr 26, 2005 11:09 pm

Here is a demo showing off the functions:
1) gluSphere
2) gluCylinder
3) gluDisk
4) gluPartialDisk
5) good ole Dovoto's textured cube

All have the ability to be textured inside and outside.
I have a bit more optimizing to do on the texture side...but I think I have the functions working pretty well. These functions will only work with GL_NONE (not smooth or FLAT), and GL_FILL (no point or line mapping?)

Press A to change the figure (or z on the PC):
press B to increase the slices/stacks/loops between 8 and 16 (or a on the PC)

Demo[PassME Version]
Demo[ideas1.0.0.3 Version]

Any comments? Bugs?


Last edited by Ethos on Wed Apr 27, 2005 12:43 am; edited 1 time in total

#41254 - ecurtz - Tue Apr 26, 2005 11:32 pm

If what you mean by "line mapping" is wireframe then you can enable that by setting the opacity to zero in the TextureMode(?) register (I don't have the docs or code here, it's normally set to 31 in the regular call.)

#41257 - dagamer34 - Wed Apr 27, 2005 12:03 am

For future demos, it would be a lot better if you were to test for a button press (keep a copy of the input register from the previous frame and compare it to the current one) instead of a certain bit being set.

Holding the A button down quickly scolls through the models, which isn't all that desirable to me at least.
_________________
Little kids and Playstation 2's don't mix. :(

#41262 - Cleon I - Wed Apr 27, 2005 12:26 am

I agree, but for the purposes of this demo it works fine.

It seems to run pretty slow on anything but the cube. Is that due to hardware limitations or lack of optimizations?

#41263 - Ethos - Wed Apr 27, 2005 12:27 am

Yeah, I noticed...especially on ideas....the faster your computer the faster it flips!!!!!!!!!!!

I fixed the demo (same link), it now will only flip to the next one per button press.
Also I set the slices/stacks/loops to 8, if you press B (A on computer) if increase the slices/stacks/loops up to 16....

Notice the speed difference between 8 and 16 :)

#41283 - thetictacaddict - Wed Apr 27, 2005 3:05 am

I just get one black (top) and one white (bottom) screen.

#41284 - arog - Wed Apr 27, 2005 3:07 am

Any chance you'll release the source code for this demo?

- Aaron Rogers
http://www.aaronrogers.com/nintendods/

#41286 - Ethos - Wed Apr 27, 2005 3:22 am

thetictacaddict wrote:
I just get one black (top) and one white (bottom) screen.


What are you running this on?
I just d/l'd, flashed, and ran on h/w to double-check the link.

If you are running an emulator, you can only used ideas 1.0.0.3

#41287 - Ethos - Wed Apr 27, 2005 3:23 am

arog wrote:
Any chance you'll release the source code for this demo?

- Aaron Rogers
http://www.aaronrogers.com/nintendods/


Source will be released when I have optimized glu routines.
So probably in a week or so.

Hopefully dovoto isn't mad that I used his texture since I am still waiting for a PCXtoTexture tool...

#41288 - thetictacaddict - Wed Apr 27, 2005 3:28 am

Ethos wrote:
What are you running this on?
I just d/l'd, flashed, and ran on h/w to double-check the link.

Hardware. It seems like it doesn't run right on FlashMe, but does on PassMe. I didn't think to try my PassMe at first.

#41290 - Ethos - Wed Apr 27, 2005 3:31 am

thetictacaddict wrote:
Ethos wrote:
What are you running this on?
I just d/l'd, flashed, and ran on h/w to double-check the link.

Hardware. It seems like it doesn't run right on FlashMe, but does on PassMe. I didn't think to try my PassMe at first.


Odd, because my DS has the firmware upgrade and works fine (that is how I tested it).

#41291 - thetictacaddict - Wed Apr 27, 2005 3:38 am

Ethos wrote:
Odd, because my DS has the firmware upgrade and works fine

That is odd. I wonder if I should try re-flashing mine. Do you know if the patch has changed at all? I got mine early on, but I didn't hear anything about changes yet.

#41297 - ecurtz - Wed Apr 27, 2005 5:40 am

Ethos wrote:
Hopefully dovoto isn't mad that I used his texture since I am still waiting for a PCXtoTexture tool...


I'm pretty sure dovoto built a PC version on the PCX to texture converter that I made as part of my MD2 conversion. It should be on his site in the Tools section. If not, PM or email me and I'll send you the source, which should either compile or require very minor fixes for your platform.

I've also had problems with demos built using the new, "tiny" loader.bin on flashed firmware. I think it's a known issue that they work with the hardware passMe or the override buttons only. I just went back to the previous version for my testing.

#41377 - Ethos - Wed Apr 27, 2005 11:24 pm

Ok, a new Optimized version is now available (same link as above)^^^
I also incorporated normal with GL_SMOOTH, GL_FLAT.

To switch Normal type , press the L button on the DS (ideas isn't mapping the button I think?)

Any more comments?

#41379 - Locke - Wed Apr 27, 2005 11:35 pm

How do you use GL_SMOOTH and GL_FLAT? I tried to find them in the ndslib code and I failed... Are them some flags or is just a term to reffer to vertex normals goraud and non-textured polys?

Btw, it seems that iDeaS has some problems with key mapping. The D-Pad axis seems to be inverted also.

#41380 - Ethos - Wed Apr 27, 2005 11:38 pm

My software adds another SIN/COS table which is used with SMOOTH and FLAT....it actually doesn't use the H/W at all

Shoulda said GLU_SMOOTH, GLU_FLAT :)

#41381 - Locke - Wed Apr 27, 2005 11:40 pm

Ethos wrote:
My software adds another SIN/COS table which is used with SMOOTH and FLAT....it actually doesn't use the H/W at all

Shoulda said GLU_SMOOTH, GLU_FLAT :)


Got it, thx ;)

#41519 - Ethos - Fri Apr 29, 2005 1:12 pm

Little update...

Code will not be released until after GBAX competition.
(Between a small texture bug + more work to be done on routines, which I will be doing while making a competition entry)

Also I heard about the PCXtoTexture converter....
well it sorta did a 8bit+palette texture.

So here is the code to replace in image.c (All the original source is at www.drunkencoders.com under DS->Tools->Graphics Converters)

Code:
int SaveNDS(char* filename, image_combined_t image)
{
   FILE *f;
   int x,y;

   // Initialize data conversion
   initLEData();

   if((f = fopen(filename, "wb")) == NULL)
   {
      return FALSE;
   }

   // 16bit version of texture
   
   for (y=0;y<image.height;y++)
   {
   for (x=0;x<image.width;x++)
   {
      unsigned short color = 0;
      int pixelIndex = x + y*image.width;
      color = (image.data[(pixelIndex)*3 + 2]) >> 3;
      color <<= 5;
      color |= ((image.data[(pixelIndex)*3 + 1]) >> 3) & 0x1F;
      color <<= 5;
      color |= ((image.data[(pixelIndex)*3]) >> 3) & 0x1F;
      color |= 0x8000;
      fwrite(&color,1,2,f);
   }
   }
   fclose(f);
   
    return TRUE;
}


A 16-bit texture which will work with the 3D texture examples.