Results 1 to 5 of 5

Thread: TBGL_GBufferDefineFromArray - can I do custom vertex types?

  1. #1
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,533
    Rep Power
    171

    TBGL_GBufferDefineFromArray - can I do custom vertex types?

    it says:
    TBGL_GBufferDefineFromArray( gbHandle, kind , items, VertexArray() [, ColorArray(), NormalArray(), TexCoordArray())

    ( a "]" bracket is missing somehow)

    Now my question is: If I don't use colors, but use Position, Normals and TexCoords - does TBGL recognize what arguments I omit?

    If I save the data later to m15-Format - is there some switch to tell which vertex-format has been used?

    'thinEdge datafile{1.0.0.6/7} just differ in normals, can I make my own vertex-format so TBGL will read my meshes?

    As I see, I can setup vertex-buffer with RGBA-Colors, but m15 seems just to support RGB?

    I don't find Materials. Are there any?

    Sample \thinBasic\SampleScripts\TBGL\GBuffers\GBuffers_SimpleShape.tBasic just shows a white screen. Has there something inside TBGL been changed so it does not work correctly any more?


    EDIT: (don't want to open another thread for this)

    called within main-loop each frame

    Function is_any_Key() As Long

    Local lCount As Long

    is_any_Key = FALSE

    For lCount = 1 To 255
    If TBGL_GetWindowKeyState(hWnd, lCount) Then
    tbgl_SetWindowTitle( hWnd, str$(lCount))
    is_any_Key = TRUE
    Next lCount

    End Function

    now if i use alt/alt Gr- keys there are returned 5 different values: 17, 18, 162, 164 and 165 - why is that?
    I do this because %VK_KEY-constants-list does not tell which keys are assumed with some keys (or I don't understand their meaning from name)


    Edit2:
    There's some mistake in TBGL_GBufferDefineFromArray-Description:
    The table of parameters says for Vertx-Array
    "Array of vertices defined as TBGL_tVertex3F for 3D or TBGL_tVertex2F for 2D", also in the following lines.

    But I can only find TBGL_tVector3F - and it wouldn't make sense to pass a whole Vertex-type to each parameter though...
    Last edited by ReneMiner; 30-10-2012 at 15:03.
    I think there are missing some Forum-sections as beta-testing and support

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732
    Brr,

    - so many typos in help file? I will fix it for next release!

    - you can't currently ommit color in this situation, I will consider it for future

    - M15 file format is what it is, for specific problems you might want to develop own format to better match your needs.

    - Materials are defined separately using TBGL_*Material* functions, as described in TBGL help file / Functions list / Materials. They are not part of M15.

    - The example SampleScripts\TBGL\GBuffers\GBuffers_SimpleShape.tBasic runs okay here.

    - The behavior of TBGL_GetWindowKeyState is based on Win32 native function GetAsyncKeyState



    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,533
    Rep Power
    171
    I decided to use Display-Lists...
    just one question about this: Is there a function like TBGL_ListExists?
    Will it crash if I delete a non-existing list or do I have to create a default-list?
    Same question for Entity-Exists? How can I find out if there is an Entity to delete? Do I have to remember if it was created?

    Edit : also some good news, it works... TBGL is great stuff, makes me happy
    Edit2: I can draw already... time to get some sleep. ( at 6:18 )
    Edit3: another request for textures, I need to know something like

    TBGL_TextureGetFreeID()
    TBGL_TextureExists()

    in general:
    all objects should have an TBGL_ObjectExists() to use enable foolproof use of all objects . So I can ask if I can use that thing instead of tracking them- it's quite obfuscating to program it - because I have to take care of this in any Sub or Function in my code and needs lots of variables to store if an element has been created, deleted or whatever.
    (for objects like entities that are assigned to a certain scene TBGL_EntityExists() could also return FALSE if does not exist and SceneID if exists...)

    The other way would be that any created object acts like this (would be a real effort):

    new equate "%TBGL_ANY" = -1 or 0 that I can use if I don't care about that ID, I'll store it somewhere anyway...

    for example

    myEntityID = TBGL_EntityCreateModelSlot(sceneID, %TBGL_ANY , ParentID, ModelID)
    myTextureID = TBGL_LoadTexture TextureFile,%TBGL_ANY, TextureFiltering [, AnisotropicLevel [, TransparentColor ]

    ...

    myObjectID = TBGL_CreateSomeObject([parameters,] %TBGL_ANY [,more parameters...])
    Success = TBGL_CreateSomeObject([parameters,] myObjectID [,more parameters... ])

    if myObjectID already exists it should be replaced

    so if I use %TBGL_ANY as parameter the functions will return the ID of the created object, which I can use to perform something with it.

    if I use some positive number (as it is now) it should return just TRUE if succesful created, or FALSE if creation failed. This would make the object-handling much easier.


    But canUseIt = TBGL_ObjectExists(myObject) on any object would be a real improvement.
    Last edited by ReneMiner; 31-10-2012 at 18:02.
    I think there are missing some Forum-sections as beta-testing and support

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732
    The getFree* were once in my roadplan, but they are not here yet as it more complicated to implement than it looks at first sight (to not break old code). Idea with TBGL_ANY sounds reasonable.

    Please do post your suggestions where they belong, that is to support section. That is the best way to keep track of it. Keeping it one feature per suggestion is needed, otherwise it results in ... mess

    I also recommend keeping one thread for each question, otherwise it is unmaintainable and the thread has low eductational value for other viewers as it goes from one topic to another.


    Petr
    Last edited by Petr Schreiber; 31-10-2012 at 19:16.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  5. #5
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,533
    Rep Power
    171
    ok. Question is done already. Not solved but I chose another way...
    I think there are missing some Forum-sections as beta-testing and support

Similar Threads

  1. Few thoughts on OpenCL, first custom problem solved
    By Petr Schreiber in forum OpenCL
    Replies: 1
    Last Post: 22-04-2010, 19:10
  2. Use of custom equates
    By marcuslee in forum thinBasic General
    Replies: 3
    Last Post: 02-09-2008, 17:05
  3. Custom dialog with button
    By Petr Schreiber in forum Templates
    Replies: 1
    Last Post: 12-04-2008, 15:33

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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