Jump to content


Go faster stripes....


  • This topic is locked This topic is locked
109 replies to this topic

Poll: Go faster stripes.... (149 member(s) have cast votes)

How fast does the optimised verison of the demo run?

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.
Vote

#81

  • Guests

Posted 05 May 2011 - 09:44 PM

Okay.... mipmapping....

For images to MIPMAP, they MUST be a POW2 size on X and Y (power of 2; 1, 2, 4,8,16,32 etc.). Images on GameMaker aren't. Now... I can automatically scale everything to POW2 (the C++ runner already does), but making everything a MIPMAP also has issues. 1st, you don't want SPRITES to "mipmap" when they scale, they would just blur and go horrible if you shrink a sprite.

This means you really need an option in GameMakers sprite dialogs to say you want something mipmapped, and then we'd have to enforce POW2 constraints. This is okay... but it means it's a bit of an effort to setup.

The other thing we could do is to give you a call in code to enable MIPMAPPING in GML, something like this...

   sprite_enable_mipmap(sprite);
   sprite_enable_mipmap(sprite,index);

We're still discussing the best way of doing this, but it's clear we can't just "switch on" mipmapping, there are too many issues for other types of games.

#82 -=ReNeX=-

-=ReNeX=-

    GMC Member

  • New Member
  • 403 posts

Posted 06 May 2011 - 12:26 AM

The optimzed doesn't run at all. It gives a generic 'Failed to initialize drawing surfaces. please check min requirements', etc.
The 8.1.71 gives off 1-2 FPS, and the Fallback reaches 17 FPS.

My current system is an AMD Sempron 3400+ overclocked to 2.2, 2GB ram @245MHz and an internal nVidia GF6150 with 128MB Shared.
I have a pcie16x nVidia GF9500GT with 1GB but the fan fell from the mount so i'm not using it right now. When i fix the fan i'll test again.
  • 1

#83 willlewis

willlewis

    GMC Member

  • GMC Member
  • 281 posts

Posted 06 May 2011 - 12:54 AM

3DCube_24BitZ_2xAA_With_AA_Fallback.exe -- 77 FPS
3DCube_gm8.1.71.exe -- 3 FPS
3DCube_24BitZ_8xAA_Optimised.exe -- Didn't run

Frequent freezes because my machine is messed up.
(Freezes for a few seconds, runs for half a second, repeats)

Pentium Dual-Core E5200 2.5GHz CPU
2GB of RAM
Nvidia GeForce 7900 GTX GPU
Windows XP 32-bit OS
  • 0

#84 EanFox

EanFox

    GMC Member

  • GMC Member
  • 58 posts

Posted 06 May 2011 - 10:38 AM

Okay.... mipmapping....

For images to MIPMAP, they MUST be a POW2 size on X and Y (power of 2; 1, 2, 4,8,16,32 etc.). Images on GameMaker aren't. Now... I can automatically scale everything to POW2 (the C++ runner already does), but making everything a MIPMAP also has issues. 1st, you don't want SPRITES to "mipmap" when they scale, they would just blur and go horrible if you shrink a sprite.

This means you really need an option in GameMakers sprite dialogs to say you want something mipmapped, and then we'd have to enforce POW2 constraints. This is okay... but it means it's a bit of an effort to setup.

The other thing we could do is to give you a call in code to enable MIPMAPPING in GML, something like this...

   sprite_enable_mipmap(sprite);
   sprite_enable_mipmap(sprite,index);

We're still discussing the best way of doing this, but it's clear we can't just "switch on" mipmapping, there are too many issues for other types of games.


How about just a "d3d_set_mipmap();" function?
So it would work like any other of those "d3d_set_..." functions.
Let's say I want everything to use mipmaping - I just enable it once, let's say, in the camera object.
But if I want to make specific objects use it, I just enable the mipmapping before drawing the object, and then disable it afterwards, like this:
   d3d_set_mipmap( 1 );
   d3d_draw_block(-s,-s,-s,s,s,s,tex,1,1);
   d3d_set_mipmap( 0 );
Or the other way around - make specific objects not use it.

Is it impossible, or does it cause too many problems?
Either way, I love that You guys are working on this - best of luck!
  • 0

#85 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 06 May 2011 - 12:22 PM

The other thing we could do is to give you a call in code to enable MIPMAPPING in GML, something like this...

Since sampler texture stage states in D3D8 are global, you can easily add a function that enables/disables mipmaps quickly. And use checkboxes / arguments to sprite/background creation functions to generate mipmaps after the image is loaded (to avoid adding +33% of texture memory for those textures which don't need it).

For images to MIPMAP, they MUST be a POW2 size on X and Y (power of 2; 1, 2, 4,8,16,32 etc.). Images on GameMaker aren't.

They don't have to be POW2. (Unless the graphics card doesn't support them but in that case, every texture is POW2 and textures wouldn't be rendered correctly, with and without mipmapping...)
Everything seems to be OK when I use non-POW2 textures with mipmapping (I used D3D9 though but I don't think anything's changed there between 9 and 8, at least I can't find it here...). Scaling usually is much slower with non-POW2 but that's the only problem I can see.

P.S. Why is GM still using D3D8? Are there any benefits to using D3D8 instead of D3D9? Or OpenGL 2? (I imagine that if you're making a Mac version, you should already have the renderer implemented in OpenGL anyway).

Edited by snake5, 06 May 2011 - 12:34 PM.

  • 0

#86 Phantom107

Phantom107

    Engineer

  • GMC Member
  • 2595 posts
  • Version:GM:Studio

Posted 06 May 2011 - 12:55 PM

P.S. Why is GM still using D3D8? Are there any benefits to using D3D8 instead of D3D9?

DirectX9 allows for a higher shader model than DirectX8, but as GM doesn't support shaders that can't be it.

Edited by Phantom107, 06 May 2011 - 12:55 PM.

  • 0

#87 EanFox

EanFox

    GMC Member

  • GMC Member
  • 58 posts

Posted 06 May 2011 - 01:22 PM


P.S. Why is GM still using D3D8? Are there any benefits to using D3D8 instead of D3D9?

DirectX9 allows for a higher shader model than DirectX8, but as GM doesn't support shaders that can't be it.

Basically what Snake meant, was that YoYoGuys doesn't have any good reason why they would still have to use D3D8.

Edited by EanFox, 06 May 2011 - 01:22 PM.

  • 0

#88 Aragon

Aragon

    GMC Member

  • GMC Member
  • 138 posts

Posted 06 May 2011 - 02:15 PM

3DCube_24BitZ_8xAA_Optimised does not work for me.
http://g2f.nl/63oz0d

3DCube_24BitZ_2xAA_With_AA_Fallback runs at stable 25 fps

3DCube_gm8.1.71 @ 1 fps

SPEC:

Graphic card: ATI Radeon 9550 / X1050 Series
Processor: AMD Athlon™ XP 2400+, MMX, 3DNow, ~2.0GHz
Memory: 1024MB RAM
  • 0

#89

  • Guests

Posted 06 May 2011 - 02:32 PM

Everything seems to be OK when I use non-POW2 textures with mipmapping...


Chances are, DX is scaling them to a POW2 for you. Remember mips are 1/2 the original size, and you can't do that if they aren't POW2.

Changing to DX9 wouldn't give very much as we currently don't allow shaders anyway. It would also take a lot of effort to change it all. I know this having already done it for the C++ runner.

#90 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 714 posts
  • Version:GM8.1

Posted 06 May 2011 - 03:20 PM

How about just a "d3d_set_mipmap();" function?
So it would work like any other of those "d3d_set_..." functions.
Let's say I want everything to use mipmaping - I just enable it once, let's say, in the camera object.
But if I want to make specific objects use it, I just enable the mipmapping before drawing the object, and then disable it afterwards, like this:

   d3d_set_mipmap( 1 );
   d3d_draw_block(-s,-s,-s,s,s,s,tex,1,1);
   d3d_set_mipmap( 0 );
Or the other way around - make specific objects not use it.

Is it impossible, or does it cause too many problems?
Either way, I love that You guys are working on this - best of luck!

It's not that simple, enabling mipmapping won't do anything if the texture (sprite/background/...) you're using doesn't have mipmaps. The mipmaps have to be generated when the texture is created by GM (you would need a checkbox in the sprite/background editor to enable or disable it), you can't do that while you're drawing it.

Edited by Maarten Baert, 06 May 2011 - 03:20 PM.

  • 0

#91 EanFox

EanFox

    GMC Member

  • GMC Member
  • 58 posts

Posted 06 May 2011 - 05:14 PM


How about just a "d3d_set_mipmap();" function?
So it would work like any other of those "d3d_set_..." functions.
Let's say I want everything to use mipmaping - I just enable it once, let's say, in the camera object.
But if I want to make specific objects use it, I just enable the mipmapping before drawing the object, and then disable it afterwards, like this:

   d3d_set_mipmap( 1 );
   d3d_draw_block(-s,-s,-s,s,s,s,tex,1,1);
   d3d_set_mipmap( 0 );
Or the other way around - make specific objects not use it.

Is it impossible, or does it cause too many problems?
Either way, I love that You guys are working on this - best of luck!

It's not that simple, enabling mipmapping won't do anything if the texture (sprite/background/...) you're using doesn't have mipmaps. The mipmaps have to be generated when the texture is created by GM (you would need a checkbox in the sprite/background editor to enable or disable it), you can't do that while you're drawing it.

Yeah, I spoke too soon - I figured that just after I wrote it.

Edited by EanFox, 06 May 2011 - 05:15 PM.

  • 0

#92 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 06 May 2011 - 06:19 PM

Chances are, DX is scaling them to a POW2 for you. Remember mips are 1/2 the original size, and you can't do that if they aren't POW2.

I don't think that was the case since I can't find any official notes about POW2 requirements for mipmapping in D3D documentation but I also can't find any samples to upload that are showing non-POW2 mipmaps in action. I'll probably make one soon then. I've once hacked up mipmapping for GM through a proxy DLL so this shouldn't take a lot of time... :D

Changing to DX9 wouldn't give very much as we currently don't allow shaders anyway. It would also take a lot of effort to change it all. I know this having already done it for the C++ runner.

Having looked at the documentation and worked with both D3D8 and D3D9, I imagined moving from D3D8 to D3D9 being more like a few hours of find-replace work than a lot of effort. Am I missing something here?
  • 0

#93 thatshelby

thatshelby

    GMC Member

  • GMC Member
  • 3823 posts
  • Version:GM8

Posted 06 May 2011 - 06:27 PM

Is having support for non-pow2 textures a big deal? Sure it would be nice, but textures are typically these sizes anyway.
  • 0

#94 GameGeisha

GameGeisha

    GameGeisha

  • GMC Member
  • 2745 posts
  • Version:GM:Studio

Posted 07 May 2011 - 01:46 AM

Here are my stats:

Unoptimized: 2-4 FPS
2xAA: 53-114 FPS
8xAA: 20-35 FPS


My machine specs:

Samsung R480
Core i3 M330, 2.13GHz
Win 7 Premium 32-bit
4GB installed RAM
NVidia GeForce 310M, 512MB dedicated video memory

It's a fairly average machine, nothing gaming-grade, but it does a great job dealing with average work and casual games.

GameGeisha

Edited by GameGeisha, 07 May 2011 - 01:49 AM.

  • 0

#95 bbb0280

bbb0280

    GMC Member

  • GMC Member
  • 570 posts

Posted 07 May 2011 - 02:19 AM

sorry, i misvoted, it doesnt play at all
  • 0

#96 jsorgeagames

jsorgeagames

    GMC Member

  • GMC Member
  • 620 posts
  • Version:GM8.1

Posted 07 May 2011 - 04:08 AM

FPS
3DCube_gm8.1.71.exe: 4-6 fps
3DCube_24BitZ_2xAA_With_AA_Fallback.exe: 49-52 fps
3DCube_24BitZ_8xAA_Optimised.exe: 17-22 fps

System Specs:
Intel Core 2 Duo
1.40 GHz, 2.00 GB RAM
Windows XP SP3
NVIDIA GeForce 8400M GS

I was quite surprised at the fps of the 2xAA Fallback - very good job on the optimization.
  • 0

#97 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 07 May 2011 - 05:20 AM

Is having support for non-pow2 textures a big deal? Sure it would be nice, but textures are typically these sizes anyway.


GM needs support for many things. Sure, you can enforce something, remove something else, but that makes it less accessible to the target audience, which includes beginner game developers. Which probably aren't introduced to the concept of avoiding non-POW2 textures like plague. :D

Anyway, Mike.Dailly, here's a sample for you: http://www.box.net/shared/41sca0888i .
Took code from CodeSampler as a starting point.
Luckily the old D3DXCreateTextureFromFileEx function didn't change anything in the image (as you probably know, the D3D9 version of D3DXCreateTextureFromFileEx scales textures to next nearest power of two size by default).
It would be really easy to notice scaling on that texture (nonpow_test.png) I chose. The result would be something like nonpow_test_manual_pow2_example.png.
The controls are in the .cpp file. You're probably interested in the F3 key which changes the mipmap filtering algorithm.
I hope this proves what I said. :)

Edited by snake5, 07 May 2011 - 05:21 AM.

  • 0

#98 michael pw

michael pw

    GMC Member

  • GMC Member
  • 1488 posts
  • Version:GM8.1

Posted 07 May 2011 - 11:43 AM

This is awesome :D!!!

3DCube_gm8.1.71.exe 3-4FPS
3DCube_24BitZ_2xAA_With_AA_Fallback 900-1422FPS
3DCube_24BitZ_8xAA_Optimised 350-800FPS



Specs:


Nvidia GTx580
AMD Phenom IIx6 (3.3Ghz)
  • 0

#99

  • Guests

Posted 07 May 2011 - 01:02 PM

snake5: Yes, that's definitely part of the reason. We don't want to complicate things for newcomers. I had a look at the demo, and it does indeed look like newer cards don't care. Because of the results we've had on this test, and the scope of the cards being used, I'm a little worried that this would be incompatible with older cards. I know older cards simply didn't allow this, although having said that... I'm surprised GM works on them at all because of this limit!

Our biggest issue is the way GameMaker creates all it's sprite/textures internally, it isn't done the way you'd expect, and that hurts. However, I was pleased to see the mipmap bias was available on DX8 (which I was unsure about as I'd never used it back then!), so it might be we can just create mipmap chains all the time, and use the bias to switch them off by default. This would then let you "select" which ones you WANT to have mipmapping (so "sprites" don't have mipmapping, and textures do).

We'll need to do lots of tests with it, and probably get the community to run some more tests for us to make sure whatever we decide works for everyone. We might be able to detect errors, but I'd need to get an old card (which I might have lying around) to check and see what happens in these cases.

All going well, then yes.... a future update could enable mipmapping as discussed above - although I think I still favour something inside GameMaker that you "tick" for a sprite. I think that would be nicer for folk to use....


EDIT: Oh... and incidentally, iOS requires POW2 textures at all time, so it might make sense to enforce this to get folk used to the idea. Sprites get away with it because we PACK them onto POW2 textures.

#100 Copernicus

Copernicus

    GMC Member

  • GMC Member
  • 27 posts

Posted 07 May 2011 - 02:12 PM

My machine:
Windows Vista Home Basic 32bit
Processor: Intel Pentium 4 CPU 3.2 GHz
Display Adapter: Intel 82945G Express Chipset Family
Memory: 501 MB.

Performance:
3DCube_gm8.1.71: 1 fps.
3DCube_24BitZ_8xAA_Optimised: Failed to initialize drawing surfaces.
3DCube_24BitZ_2xAA_With_AA_Fallback: 125 fps, but no texture (only white lines were drawn).
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users