Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

simple opengl example project?

Discussion in 'Scripting' started by thefluidimage, Jun 25, 2007.

  1. thefluidimage

    thefluidimage

    Joined:
    Oct 31, 2006
    Posts:
    6
    does anyone have or know of the 'simplest' project that would demonstrate opengl drawing in unity pro? even drawing a quad would suffice, so long as the calls to draw are GL.

    we can't seem to engage the gl system to draw. so we need a simple debug case that works. an entire project that would encapsulate all state would be ideal.

    thanks!
     
  2. DaveyJJ

    DaveyJJ

    Joined:
    Mar 24, 2005
    Posts:
    1,558
    bronxbomberman (aka Jedd) has been doing some stuff in OpenGL and hopefully he'll drop by and see this.
     
  3. bronxbomber92

    bronxbomber92

    Joined:
    Nov 11, 2006
    Posts:
    888
    Dave, I think he knows OpenGL, just can't get it to work in Unity. Since I don't have Pro, I can't actually give him a working example XD.

    Sorry, I look forward to seeing how to use the GL class in Unity though :)
     
  4. DaveyJJ

    DaveyJJ

    Joined:
    Mar 24, 2005
    Posts:
    1,558
    Ah, my mistake then.
     
  5. thefluidimage

    thefluidimage

    Joined:
    Oct 31, 2006
    Posts:
    6
    indeed, we're pretty GL tested. and i started down the debug path until i realized that we could be looking at a very low level problem - like the build isn't allowing GL code to draw in its context.

    i appreciate the assistance.
     
  6. hsparra

    hsparra

    Joined:
    Jul 12, 2005
    Posts:
    750
  7. thefluidimage

    thefluidimage

    Joined:
    Oct 31, 2006
    Posts:
    6
    thanks! that got something drawn to the screen (i was skeptical). and i was able to duplicate in c# (our native script) and c. so GL is in fact working. once we're through, i'll post a complete project that may be useful for debugging.
     
  8. Brian-Brookwell

    Brian-Brookwell

    Joined:
    Sep 14, 2012
    Posts:
    47
    Here's a project I used as the first lecture in a Computer Science Graphics course I teach for MacEwan University. It doesn't do much, though, except use triangles to display a square or hexagon.
     

    Attached Files: