Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: [D3D] possibilities and techniques concerning 2d

  1. #1

    [D3D] possibilities and techniques concerning 2d

    Hi.

    I am wondering what the possibilities of Direct3d are concerning 2d. Is it possible to do the following:

    A: :?: Load a texture from a stream or memory location??

    B: :?: Reading an Writing pixels, from a texture or the whole screen(backbuffer).

    C: :?: Using GDI functions like line/rectangle/ellipse, on Textures or the whole screen.

    D: :?: Blitting Textures on Textures.

    E: :?: Using multiple textures for a single polygon.
    I mean that every vertex can contain a texture
    and its coordinates, so that they are blended in
    the middle of the polygon. (just like what is
    done with colors, in those basic d3d tut's).

    And... Is it worthwile to program some resource preparing routines. :razz:

    For example, when a texture must be able to rotate in the game, is it worthwile to create a routine that copies the texture about 36 times and increase the angle for each of them with 10 degrees.
    And when the texture must be drawn, just calculate the image index and draw the appropriate image.

    Since Direct3d can transform objects very fast, i am not sure if this is neccesary. Can i gain some extra speed with this method??

    Thanx in advance
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2

    [D3D] possibilities and techniques concerning 2d

    I think the answer is yes to most of your questions.
    As far as I know d3d is able to lock the pixels of a texture and have direct access to the texture pixels.

    As far as blitting to the texture i don't think it's very much worth it. there are probably better ways as altering textures on the fly generally is very slow.

    Multiple textures per polygon is called multitexturing

    About rotating textures you are able to alter the texture coordinates so that the texture will be rotated on the polygon itself. This is much faster and better memorywise as you only have to store the texture once
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #3

    [D3D] possibilities and techniques concerning 2d

    Hi JSoftware..

    Thanx for you answer. :razz:
    i did some research and i've found some info on MSDN about surface locking and GDI drawing on textures. :lol:

    As far as blitting to the texture i don't think it's very much worth it. there are probably better ways as altering textures on the fly generally is very slow.
    What is "texture altering"?? :?

    I still dont know how multitexturing is done. I need some info about how to assign different textures to a different vertices and e.g make a gradient with a dirt texture and a water texture.

    I couldn't find any of the above discirbed tutorials or examples so far.
    A good expanation of multitexturing would be highly appriciated.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  4. #4

    [D3D] possibilities and techniques concerning 2d

    I think you misunderstood JSoftware. "texture altering" is not a function or anything.

    Is Direct3d a requirement or is Opengl optional for you as well? It tends to be a bit easier and to my knowlegde the availabillity of tutorials and other related information is bigger for opengl.

    There are in fact numerous samples available for multitexturing in opengl. here and here for example

  5. #5

    [D3D] possibilities and techniques concerning 2d

    I think you misunderstood JSoftware. "texture altering" is not a function or anything.
    Okay i looked it up.. and now i understand.

    I use Direct3d because i know it a lot better than OpenGL. I've tried GLScene a few months ago but it didn't work well. When i dropped the Camera object on the form, the following error occured:

    "Need at least openGL 1.1".

    This happens on both of my computers :cry: I have downloaded and installed a version op OGL 1.1 (a small zip with some DLL's and a few C++ headers) but it didn't work. Anyone knows a solution??

    Still don't know anything about multitexturing.
    If you do.. please let me know.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  6. #6

    [D3D] possibilities and techniques concerning 2d

    upgrade your graphics drivers

  7. #7

    [D3D] possibilities and techniques concerning 2d

    I tried to reinstall GLScene but the following happened:

    File not found 'PlugInIntf.dcu'.

    I dont know this file, and couldn't find it.
    Can anyone help me?? :cry:
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  8. #8

    Re-

    I have learn a lot from this tutorials collection:


    http://externalweb.exhedra.com/Direc...TUT_DX8_DG.asp

    It is in VB but the directx command/functions and parameters are the same for any lenguage programming. It is focused in directx 8.1, so be sure your videocard supports that.

    Tutorial About multi-texturing:

    http://externalweb.exhedra.com/Direc...R_Lesson12.asp


    good luck.

    tp.

  9. #9

    [D3D] possibilities and techniques concerning 2d

    thank you VERY much.

    This site is full of interesting D3D information.
    I've got something to do this weekend. :read: :lol:

    I have two PC's. My own only hardware-supports DX7 but i think i can still use most of the info.

    Edit: i must realy stop including 'Delphi' in my google searches to new DX info.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  10. #10

    [D3D] possibilities and techniques concerning 2d

    I started reading the tutorial about gaining access to texture memory, and they use this function I couldn't find in DX9:

    DXCopyMemory

    Is there an equivalent in DX9?? :?

Page 1 of 2 12 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
  •