Results 1 to 18 of 18

Thread: ClanLib 2.0 Minimum Hardware Requirements

  1. #1

    Default [SOLVED] ClanLib 2.0 Minimum Hardware Requirements

    Hi all, first of all thanks for this useful library.
    I've been using this new version for a while and I had no problem with it.

    I would like to know the minimum hardware requirements to use ClanLib 2.0 with OpenGL.

    I'm developing a 2D game that uses shaders like normal mapping, dynamic lighting etc.. (no problem with it) but I would like to implement a "low quality" renderer that uses only the fixed pipeline for older hardwares.

    In order to do that I'm searching to know what is the minimum hardware that is needed to run ClanLib 2.0 with OpenGL because I've seen that ClanLib 2.0 uses simple shaders internally (see CL_Draw helper class) and not the fixed pipeline.

    Thanks for any help!

    Claudio
    Last edited by wizardofoz; 05-24-2009 at 09:01 AM.

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    ClanLib (2.0.x) OpenGL minimum is 2.0 (ClanGL)

    There are 2 choices for the software renderer, ClanSDL and ClanGDI

    ClanSDL is based around SDL ( http://www.libsdl.org/ )

    ClanGDI is ClanLib's own software renderer, with the ClanLib licence.

    ClanGDI renderer is multicore processor aware, so it equally spreads rendering tasks to seperate threads.

    At the moment, ClanGDI is not up to full speed yet, as some specialisations are required in assembly.

  3. #3

    Default

    Thank you for your prompt reply.

  4. #4

    Default

    Is there the plan to include some legacy OpenGL < 2.0 renderer to use 3D acceleration without shaders?

    I think that more than one user who likes playing games mostly in 2D could not have bought a recent video card that fully support OpenGL 2.0.
    Moreover now there are many people with mini-notebooks (Windows XP or Linux, Intel 945 mobile video card, 1 Gb Ram...) that are cheap () but support only OpenGL 1.4. ))

    I love programming with shaders, very cool effects. I've already written a prototype of post-process compositor for this engine, but it would be very cool if the games made with ClanLib 2.0 could also be played with mini-notebooks and older computers.

    Yes there are ClanGDI and ClanSDL and they are awesome, I've implemented a switchable render system in my engine between ClanGL, ClanGDI and ClanSDL but there are some vital functions and features, like rotations for example, bilinear filtering, anti-aliasing,fast render batching, blending modes (add, modulate, alpha-blending...) that they cannot perform and 3D-acceleration working pipeline is always a better choice in my opinion istead of software rendering.

    What do you think?

    Thanks again for your attention!

  5. #5
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    I'm not sure any of the core developers are planning on doing this, we already have our hands full.

    But if anyone volunteers to make such a target, we'll of course provide guidance

  6. #6

    Default

    But if anyone volunteers to make such a target, we'll of course provide guidance
    I hope that someone with the right skills accepts this task

    I've also thought to a possible solution to my problem:

    Could I switch from ClanGL of ClanLib 1.0 and ClanGL of ClanLib 2.0 using abstract interfaces?

    This would need a bit of work but maybe not so much.

  7. #7
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    The API of ClanLib 1.0 and 2.0 are different in many many ways, including the dependent libraries like clanCore. You'll end up wrapping entire ClanLib if you go down that route

    Coding a clanGLLegacy is probably not that hard, you can probably use the existing clanGL as a base, and replace those few functions that actually renders geometry to use a fixed pipeline approach.

  8. #8

    Default

    I'm doing some experiments in the way you have suggested..

    In ClanLib 2.0 can I assume for the fixed function pipeline that attributes passed to draw_primitive_arrays() can be the following?

    attribute 0 = POSITION,
    attribute 1 = COLOR
    attribute 2 =TEXTURE COORD

  9. #9
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    It is slightly more complicated than that.

    The attributes are determined by the program object currently active.

    For a fixed function target (like GDI, SDL or OpenGL 1.3), only the standard shaders needs to be supported. The attributes used vary between the standard shaders, and they are assigned as follows:

    cl_program_color_only:

    attribute 0 = POSITION
    attribute 1 = COLOR

    cl_program_single_texture:

    attribute 0 = POSITION
    attribute 1 = COLOR
    attribute 2 = TEXTURE COORD

    cl_program_sprite:

    attribute 0 = POSITION
    attribute 1 = COLOR
    attribute 2 = TEXTURE COORD
    attribute 3 = TEXTURE INDEX (0-3 for a bound texture or 4 if its a color fill with no texture)

    The sprite program is what our batching engine for CL_Sprite and CL_Image uses to render up with up to 4 different textures in a single call to draw_primitives_arrays.

  10. #10

    Default

    Yes fixed function pipeline has to support the standard shaders.
    Last edited by wizardofoz; 06-15-2009 at 12:19 AM.

  11. #11

    Default

    I think I've made good improvements on this works. At first I begun to create a separate ClanGLLegacy when I realized that this class would have been in conflict with ClanGL..to many duplicates etc..

    So I created this solution:

    1) opengl_context_provider cpp/h
    I made virtual only the functions that change in fixed function pipeline.
    For example: virtual void set_program_object() = 0;

    2) I created two separated implementations for these virtual functions only:
    a) CL_OpenGL20ContextProvider: opengl_2_0_context_provider.cpp/h
    b) CL_OpenGLLegacyContextProvider: opengl_legacy_context_provider.cpp/h

    3) I modified check_opengl_version to check OpenGL 2.0 for the first and OpenGL 1.3 for the second implementation.

    3) In opengl_window_provider:
    Code:
    try
    {
       gc = new CL_OpenGL20ContextProvider(....)
    }
    catch(CL_Exception &e)
    {
       gc = new CL_OpenGLLegacyContextProvider(...)
    }
    I tried this solution in one mini notebook (OpenGL 1.4) and my test program has gracefully scaled to CL_OpenGLLegacyContextProvider.

    I've implemented fixed-pipeline with clVertexPointer, clColorPointer, clTextureCoordPointer, clDrawArray, clClientActiveTexture, clEnableClientState and clDisableClientState and if I'm not wrong these would require an OpenGL 1.3 or above (GeForce3 or above).

    In my mini-notebook test I was able to display a simple sprite and rotate it, fill a gradient, fill a rect and draw a circle. These are obviously not big test but these seem to work.

    If you think that it could be a solution for you I can send the project files (Visual Studio 2008).

  12. #12
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Can you post the patch onto the forum (zip it)

    I have created a clanGLES1 target for support for clanGL < 2.0 that should support OpenGL ES 1.1 (and OpenGL 1.x)

    It would be helpful to incorporate your patch.

  13. #13

    Default

    Here's the patch against the last ClanLib SVN build plus 4 new files that are the implementation of the context provder for OpenGL 2.0 and OpenGLLegacy.

    I tested only the Win32 version.

    Please let me know what do you think!

    P.S It would be very nice to have some sort of getGLVersion() or isCustomShaderSupported() directly accessible from the compiled library instead of having to do a manual hack with clGetString(CL_VERSION);
    Attached Files Attached Files

  14. #14
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Thanks

    The ClanGL1 target is now being developed.

    (Not - clanGLES1 as clanGL1 should still be able to be used for OpenGL ES1.1)

  15. #15
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    ClanGL1 now exists in the SVN

    See http://www.rtsoft.com/forums/showthread.php?t=2708

    Thanks for wizardofoz for the patch. In the end, I only used a part of the set_primitives_array function. Hope it's all okay.

  16. #16

    Default

    Thank you rombust for your work, I'll upgrade my ClanLib version and try ClanGL1 as soon as possible.

    P.S. glBindBuffer doesn't work until OpenGL 1.5... what about glBindBufferARB ? It's an extension so it could be avaiable before 1.5..

  17. #17
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Quote Originally Posted by wizardofoz View Post
    P.S It would be very nice to have some sort of getGLVersion() ... [snip] ... instead of having to do a manual hack with clGetString(CL_VERSION);
    Implemented in SVN:

    To use :-
    Code:
    		CL_GraphicContext_GL new_gc(gc);
    		int major, minor, release;
    		new_gc.get_opengl_version(major, minor, release);
    (Note, CL_GraphicContext_GL1 also has this, and some other OpenGL 1.x functions)

  18. #18

    Default

    Thank you very much rombust for ClanGL1 and for the function get_opengl_version. Your hard work is much appreciated!

Similar Threads

  1. No hardware acceleration available.
    By sunnyplain in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 01-18-2008, 10:17 AM
  2. additional requirements for clanlib apps to run
    By killarkai in forum Official ClanLib SDK Forums
    Replies: 10
    Last Post: 09-19-2006, 06:22 AM
  3. Replies: 2
    Last Post: 10-10-2003, 07:01 PM

Bookmarks

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
  •