Page 1 of 3 123 LastLast
Results 1 to 10 of 179

Thread: nxPascal

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    I just got a weird theory to optimize texture memory... There are times when you just need textures that are not power of 2, for example odd 300x200 image. nxPascal can currently load that as either scaled to nearby size (256x256 in this case) or pixel-perfectly unaltered but fit in 512x256 "frame". However the "frame" will in this case waste alot of unused memory.

    What i came up with (as just idea so far), is that i'd have 2 integer (word) variables per texture: XPart, YPart. The loader would calculate perfect fit for image that is divided in 1, 2 or 4 subtextures. That 300x200 would be divided in 2 parts to make as whole a 320x256 "frame", because the height cannot be split in 2:
    256x256, 64x256

    If i count memory saving for RGBA image:
    300x200 originally as 512x256 "frame" needs 524288 bytes.
    2 subtextures need 262144 + 65536 = 327680 bytes
    which is 62.5% of memory that would normally be reserved.

    Obviously this will need draw functions to adapt to subtextures but it shouldn't be problem. 3D model surface would be unable to use this well, but models should always use the scaling option anyway for repeatability.
    Edit: Actually it is big problem if want to support patterned drawing... I'd propably disable/ignore patterns when this is used.

    Also, i just got BASS musics working with Lazarus so that's what i'll be using. Need to make a class wrapper to it to ease the procedural DLL header unit.
    Last edited by User137; 13-10-2011 at 04:57 PM.

  2. #2
    Decided to make another video. Combination of various features, first off background is 800x600 QuadTexture. Followed by 2 particle launchers at bottom corner, from which right side is a clone of left one. Mouse cursor drops snowflakes which have gravity applied to them. Then there are 3 trail effects also part of particle engine.

    Top top it off, all of that is drawn only in framebuffer. There is a 50x50 grid of indexed GL_QUADS vertexarray, which acts as screen. This let me do a "collapse" effect at where blue trail is moving, basically the grid bends towards it like spacetime

    Background music comes also from the application, by nxBass unit, that is some of BASS library simplified to OOP way of programming.
    This is all there is to it in main program, and it can handle alot of formats:
    Code:
      bassSound:=TBassEngine.Create(handle);
      if not bassSound.CheckErrors then begin
        bassSound.Add('music','data'+PathChar+'test.s3m').  Play;
      end;


    Wireframe option is added to render settings. Unfortunately i can't upload engine sources yet because this broke my model demo that used placeholder particletype. 3D particle rendering isn't ready yet. But adding me to MSN or asking with private message always works and i can send anything.

    Compiled demo added to attachments, let me know if there are any problems running it
    Attached Files Attached Files
    Last edited by User137; 15-10-2011 at 09:09 PM.

  3. #3
    Works flawless here. > 120 FPS on my 8600GT. Good job on this one.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  4. #4
    That seems hard-limited maybe, vsync? Mine is not forced on in driver settings. It actually has no FPS limiter, not even sleep(1), so its giving me 1500-2200 FPS.
    Forgot to mention, the grid is toggled with spacebar key.

    Also i will include this demo in the nxPascal demos sometime soon, need convert the Delphi version aswell.

  5. #5
    Seems very likely that my drivers use v-sync then. It's pretty stable around 120 FPS.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  6. #6
    Finally got done what i was supposed to. 3D support for particle engine is there, and you can test it all. Check first post for updated links. Mainly do check the model and effects1 demos, they're quite an update to earlier ones. All demos are tested working on Lazarus and Delphi7.

  7. #7
    Spent pretty much whole day fighting with Synapse network library I wanted to test it in action so i had to make a small "game". In the process alot of bugs got found and eliminated, and finally everything worked smooth. My test had 5 client windows connected to the same server, each with unique 2D spaceship that was showing flying on all screens. Random crashes at exit are no more.

    What got me puzzled for long time was simple string comparison. In the authentication i have string1 and string2. Then string2:=string1; Now pass string1 into MaskCrypt() and i discovered that string2 changed aswell Crazy pointer logics there. So in order to copy string to another i have to do it with string2:=copy(string1, 1, 255);

  8. #8
    Quote Originally Posted by User137 View Post
    Decided to make another video. Combination of various features, first off background is 800x600 QuadTexture. Followed by 2 particle launchers at bottom corner, from which right side is a clone of left one. Mouse cursor drops snowflakes which have gravity applied to them. Then there are 3 trail effects also part of particle engine.

    Top top it off, all of that is drawn only in framebuffer. There is a 50x50 grid of indexed GL_QUADS vertexarray, which acts as screen. This let me do a "collapse" effect at where blue trail is moving, basically the grid bends towards it like spacetime

    Background music comes also from the application, by nxBass unit, that is some of BASS library simplified to OOP way of programming.
    This is all there is to it in main program, and it can handle alot of formats:
    Code:
      bassSound:=TBassEngine.Create(handle);
      if not bassSound.CheckErrors then begin
        bassSound.Add('music','data'+PathChar+'test.s3m').  Play;
      end;


    Wireframe option is added to render settings. Unfortunately i can't upload engine sources yet because this broke my model demo that used placeholder particletype. 3D particle rendering isn't ready yet. But adding me to MSN or asking with private message always works and i can send anything.

    Compiled demo added to attachments, let me know if there are any problems running it
    If I may ask, what is the music in the above video?
    I quite like it

  9. #9
    Quote Originally Posted by paul_nicholls View Post
    If I may ask, what is the music in the above video?
    I quite like it
    I think it's S3M called "In the mist", was free download from some site. It's actually the demo (this demo is included in the downloads) playing it with BASS library I didn't separately attach it to video.

    Oh, i could also make a small game for a demo too. Anyone have ideas what it could be? I'm actually fan of Tetris myself, lol.
    Last edited by User137; 03-01-2012 at 04:59 PM.

  10. #10
    Quote Originally Posted by User137 View Post
    I think it's S3M called "In the mist", was free download from some site. It's actually the demo (this demo is included in the downloads) playing it with BASS library I didn't separately attach it to video.

    Oh, i could also make a small game for a demo too. Anyone have ideas what it could be? I'm actually fan of Tetris myself, lol.
    Thanks for the song info, I found and downloaded it
    http://lite.modarchive.org/index.php...id&query=71153

    Hmm...maybe I should see if I can make some code to play S3M songs - those type of songs are very small in size and would be perfect for inclusion into my game, but I don't want to distribute YAL (Yet Another Library) haha

    Not sure what type of game you could make, maybe a 2d tile-based plaformer that has 3d objects in it? That could be fun and not too hard
    Last edited by paul_nicholls; 03-01-2012 at 09:52 PM. Reason: updated post

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •