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

Thread: NVIDIA CG in thinBASIC

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,146
    Rep Power
    735

    NVIDIA CG in thinBASIC

    Hi,

    week ago, Abraxas send me message about VisualBASIC 6 tutorials, which show how to use NVIDIA CG in VB.
    VB uses wrapper library created by Paul Dahuach, but as it is DLL, thinBASIC can use it too.
    Yesterday I made another exam, so to celebrate a bit I did the conversion

    Here is attached sample "Ejemplo 2" ( see all original VB samples here ), which basically paints primitives red .

    You will need NVIDIA CG installed ( or at least have cg.DLL and cgGL.DLL in same directory as the script ), not sure if it is suitable for ATi/Intel/S3/Matrox... , I guess not :'(

    The CG is shader language developed by NVIDIA, something like GLSL, but little different.
    You can design shaders in kind of visual way using NVIDIA FX Composer too.

    Have fun, more complex samples will come once I will have more time again.


    Bye,
    Petr

    P.S. The wrapper cgVB.DLL probably will not be necessary once I will do cg*.h headers conversion

    Learning resources
    The CG Tutorial
    eBook from NVIDIA, explains CG from the basics
    Attached Images Attached Images
    Attached Files Attached Files
    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

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

    Re: NVIDIA CG in thinBASIC

    You can play with the shader and see what it does,
    for example modifying file C2E1v_red.cg ( from zip above ) to:
    struct C2E1v_Output {
    float4 position : POSITION;
    float3 color : COLOR;
    };

    C2E1v_Output C2E1v_red(float2 position : POSITION)
    {
    C2E1v_Output OUT;

    OUT.position = float4(position,0,1);
    OUT.color = float3(1+position.x,position.x > position.y,0);

    return OUT;
    }
    ... will give completely new look, as seen on image below


    Petr
    Attached Images Attached Images
    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

    Re: NVIDIA CG in thinBASIC

    Hey Petr, I thought I'd tell you that it works on my graphics card.

    I just downloaded the redistributable binaries from this page & installed them.
    Operating System: Windows 10 Home 64-bit
    CPU: Intel Celeron N4000 CPU @ 1.10GHz
    Memory: 4.00GB RAM
    Graphics: Intel UHD Graphics 600

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,146
    Rep Power
    735

    Re: NVIDIA CG in thinBASIC

    Hi,

    I thought you have some Intel or SiS onboard, if it does work with it then I am saying bye to GLSL ;D
    Am I correct?


    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

  5. #5

    Re: NVIDIA CG in thinBASIC

    Yeah, my old XP laptop had a SiS card, my new Vista laptop has an Intel card.

    I've tried both the thinBasic examples & they worked, the original VB6 examples wouldn't work but that's probably because VB6 programs aren't really supported on Vista.
    Operating System: Windows 10 Home 64-bit
    CPU: Intel Celeron N4000 CPU @ 1.10GHz
    Memory: 4.00GB RAM
    Graphics: Intel UHD Graphics 600

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,146
    Rep Power
    735

    Re: NVIDIA CG in thinBASIC

    Thats is fantastic news,

    thanks a lot Matthew!


    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

  7. #7
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    404

    Re: NVIDIA CG in thinBASIC

    Petr, I will test it tonight... the eeepc has an intel graphics chip... will report back then. Am installing apps tonight on it.
    I love how you can just crank out one surprise after another when you have even just a little bit of time, congrats on your exams
    going well by the way!
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  8. #8
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    404

    Re: NVIDIA CG in thinBASIC

    I get an error on the eeepc. The intel 915gm in the chart says it should support shaders.
    http://www.intel.com/support/graphics/sb/cs-014257.htm

    Attached is a screenshot of the dll's I placed from the binaries that Matthew linked to.
    Attached Images Attached Images
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,146
    Rep Power
    735

    Re: NVIDIA CG in thinBASIC

    Hi Kent,

    thanks for the testing, Intel claims on that site that:
    Intel provides an optimized graphics pipeline for vertex processing that is included in Microsoft* DirectX*. This can be used by games to provide software geometry processing.
    ... so D3D only? I think I read somewhere Intel does vertex shaders in software mode anyway, will try to find that source and check what they write about fragment shaders.
    It is quite odd to support VS 1-3 but PS 1-2


    Thanks,
    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

  10. #10
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    404

    Re: NVIDIA CG in thinBASIC

    I saw that too about D3D, but why directx and not opengl... doesn't make sense to me. I will do more tests as I install things and write back in the future.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

Page 1 of 2 12 LastLast

Similar Threads

  1. NVIDIA FX Composer
    By ErosOlmi in forum Technology
    Replies: 1
    Last Post: 22-07-2008, 16:11

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
  •