Page 6 of 18 FirstFirst ... 4567816 ... LastLast
Results 51 to 60 of 179

Thread: nxPascal

  1. #51
    Just quick sidenote, that GLSL fragment-shader is now supported. Fpc and Delphi demos about the topic included. Code about it in main program, is like most other stuff in nxPascal, short and simple!

    It is not long class as you can see there http://code.google.com/p/nxpascal/so...k/src/nxGL.pas
    but if i plan to make a default shader for 2D, and simulate glVertex, glColor etc with VBO, it may grow in size. For now i only have some theory in mind on polygon-stack... Every Draw, DrawRotate commands etc. are at the moment using old glBegin- style. 3D-models use vertex-arrays, and VBO is so far unsupported (unless you do it yourself with dglOpenGL header).

    Demo is modified and simplified of earlier:


    Also updated compiled win32 demos link, so you can preview the latest:
    http://nxpascal.googlecode.com/files...ed_demos_2.zip

    Last time i tried some big texture with non power of 2 it came out white.
    Forgot to update on this topic too... There was parameter error in glTexImage2D. InternalFormat cannot be 3 or 4, but instead GL_RGB and GL_RGBA. After this small fix, texturing unit is now supporting non-power of 2 sizes for images as default. Say hello to your 800x600 backgrounds
    Last edited by User137; 17-08-2012 at 11:03 PM.

  2. #52
    nxPascal actually has SVN changelog too: http://code.google.com/p/nxpascal/source/list
    though i can tell more about the changes here when simple log-entry is not enough.

    I was requested few new features for the engine and so here is some new stuff:

    CreateCube, CreateSphere, CreatePlane, CreateTorus procedures are added for 3D-model class.

    Also there is new demo on mouse-picking. It features flying in free 3D-space, and pointing objects with cursor. It is supporting object positioning and rotation with matrix. Both only available in SVN for now.

    And managed to create default shaders for 3D and 2D supporting colors and textures. So some point the VBO renderer will progress again, and i am finally rid of all glBegin etc calls. (They are only used in 2D.)
    Attached Images Attached Images
    Last edited by User137; 24-08-2012 at 09:25 AM.

  3. #53
    So this means, most of the stuff will be based on shaders?
    I guess i have to learn them finally. Atm i don't know nothing much about them, they are still some black box to me that does some magic. But how, no idea.
    Maybe i just lack interest in shaders. Particulary because i have old PC with old gfx card: Ati Radeon 9550.


    My suggestion to you. If you make any new test, like this shader example, also you said something about torus test.
    You should include them as examples / demos. Because there is no help file, examples / demos is the only reference.
    If someone just doesn't post questions here or PM for getting help. But still, i think, every bit of demos helps.


    EDIT EDIT EDIT:
    I think i found a bug or it's just my Delphi.

    Anyway, in file nxGL.pas at lines 87 and 88, there is missing 'overload' directive.

    It looks like this by default:
    procedure Render(Indexed: boolean = true);
    procedure Render(first, _count: integer; Indexed: boolean = true);
    But should be:
    procedure Render(Indexed: boolean = true); overload;
    procedure Render(first, _count: integer; Indexed: boolean = true); overload;
    If there is no overload directive, Delphi throws an error. I just downloaded latest from svn, tried to rebuild all and got an error.
    Last edited by hwnd; 23-08-2012 at 10:32 PM.

  4. #54
    Quote Originally Posted by hwnd View Post
    So this means, most of the stuff will be based on shaders?
    I guess i have to learn them finally. Atm i don't know nothing much about them, they are still some black box to me that does some magic. But how, no idea.
    Maybe i just lack interest in shaders. Particulary because i have old PC with old gfx card: Ati Radeon 9550.
    Hmm, my card is Radeon 5700. Unsure which is newer. All you need is OpenGL 2.0 support to use pixel-shaders, and current versions are already going at 4.0+. So all card i know of propably supports them. Also, if shaders would make rendering slower, there wouldn't be point in using them right? I believe it will be opposite, and great boost to performance actually. You can check the current shader-candidates in nxShaders.pas. I use its 3D version in the bump-mapping demo. (change 1 parameter and it disables normalmap)

    Also about the rendered i mentioned, it is for 2D. All 3D-graphics are already using vertexarrays, and can be easily adapted to VBO, because the data buffers remain the same. But all DelphiX-like commands like DrawRotate needed the new 2D-shader built. I can do all the array work behind the scenes, so a new just starting out game programmer might not even know that stuff is drawn with pixel-shaders.

    Quote Originally Posted by hwnd View Post
    My suggestion to you. If you make any new test, like this shader example, also you said something about torus test.
    You should include them as examples / demos. Because there is no help file, examples / demos is the only reference.
    If someone just doesn't post questions here or PM for getting help. But still, i think, every bit of demos helps.
    It is good idea. Redownload the SVN, you'll see Picking demo now use all the new models, except Plane, because why show just 1 rectangle?

    Some point i may try land generation with the plane, using it for heightmap. But static model is rarely good idea for land, especially if it can be big. But it can act as a dynamic buffer either way. Also if you Assign it to TVertexArray you can add colors-array per-vertex.

    Yeah same code didn't compile on my Delphi either. It's always 1 change in fpc that can make things break for Delphi But it's fixed.

    edit: Seems like first post wasn't up-to-date with links
    Last edited by User137; 24-08-2012 at 10:30 AM.

  5. #55
    There was big math update yesterday for quaternions, and operator overloading support for fpc for vectors, matrices and quaternions. But today something more interesting that is 3D-sounds with BASS. The sound class would let me if i wanted to: change track position on each sound source, change their volumes, change how fast the sound fades out and so on. Even doppler effect is present when moving fast beside sound sources.
    Last edited by User137; 31-08-2012 at 05:03 PM.

  6. #56
    is this as new demo included? or combined with picking demo. all in one?

    examples will be hard to follow, if so

  7. #57
    It isn't currently included in any demo. Also the functions used are quite straightforward, even default values are tuned so that they would fit most purposes with no configuration.

    Code:
      sound:=TBassEngine.Create(handle, true); // Set true to enable 3D
    
      // Move and rotate listener while sounds are playing
      sound.listener.SetLocation(pl.position);
      // Front and up vectors from listener's rotation matrix
      sound.listener.SetOrientation(getvector(pl.rotation, 2), getvector(pl.rotation, 1));
    
      // Attach sounds to objects
      for i:=0 to high(obj) do begin
        sound.Add('music', 'sounds\test.s3m', true); // Again true to enable 3D for this specific sound too
        with sound.sound[i] do begin
          // Move and rotate object sounds
          SetLocation(obj[i].position);
          SetOrientation(getvector(obj[i].rotation, 2)); // front vector "where object is looking at"
          looped:=true;
          Set3DAttributes(0, 100, 360, 360, 0); // Detailed config values, optional
          Play;
        end;
      end;

  8. #58
    Added a ton more information to wiki today: http://code.google.com/p/nxpascal/wiki/Introduction
    Hope you can find it useful, but remember to let me know of areas that desperately need more information. Many unit-descriptions are still just scratching the surface, but i felt like that was alot of work done.

  9. #59
    Looks nice so far. Such wiki is very welcome.

    btw i wanted to ask. do you know any path finding lib or code that works in 3D?
    i mean that works with XYZ. i would like to do some tests. if one mesh can follow or find a path to second, if its upstairs or something.
    or the pathfinding method doesnt matter for such a thing.
    and nxpascal pathfinding is enough?
    i have some ideas here.

  10. #60
    It's currently not set to work with 3D. It is a tile-based finder where adding 1 dimension would explode its memory and performance needs. Most optimal thing would be to build a tree of nodes for the map. It would work for 2D and 3D, work faster and take less memory than current, but it building such tree is not simple. Especially when there's alot of different kinds of game worlds. Personally i haven't had need for pathing for long time so it's just 1 of those things left aside

Page 6 of 18 FirstFirst ... 4567816 ... 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
  •