User Tag List

Page 10 of 11 FirstFirst ... 8 9 10 11 LastLast
Results 91 to 100 of 107

Thread: OpenGL Base object ( public beta )

  1. #91
    Clicker Multimedia Fusion 2
    Retriever2's Avatar
    Join Date
    Jun 2006
    Location
    United States
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Texture object ( public beta )

    For what it's worth the .net examples also don't work for me.

  2. #92
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Texture object ( public beta )

    Right now it's just the .net stuff that does not work for me but the included Xlua stuff works ok.

    My folder structure is slightly different though now because Min linked to the old OpenGL folder for the examples which had Looki's stuff before. What i have now is in the main folder the new OpenGL stuff with the opengl.dll and Tao.OpenGL.dll also. Then i have a sub folder with the older stuff by Looki in it.

    I do have a XLua based example that does not work and thats one i made -

    Code:
    -- SETUP TRIANGLES --
    numTris = 70
    triangles = {}
    
    for i=0, numTris, 1 do
      triangles[i] = {}
      -- Initial position
      triangles[i].x = math.random( 20 ) - 10
      triangles[i].y = math.random( 20 ) - 10
    
      -- Initial speed and direction
      local a = math.rad( math.random( 360 ) ) -- Random degree converted to radians
      local v = 0.15
      triangles[i].vx = math.cos( a ) * v
      triangles[i].vy = math.sin( a ) * v
    
      -- Initial rotation value and rotation speed
      triangles[i].r = math.random( 360 )
      triangles[i].rs = math.random( 100 ) / 100.0 + 1.0
    
      -- Initial scale
      triangles[i].s = 2.25
    
    end
    
    
    -- OPENGL SETUP --
    width  = 320.0
    height = 240.0
    
    gl.ClearColor( 0, 0, 0, 1 )
    
    gl.MatrixMode( gl.PROJECTION )
    gl.LoadIdentity()
    glu.Perspective( 45, width/height, 0.1, 100 )
    
    gl.MatrixMode( gl.MODELVIEW )
    
    -- Enable additive blending
    gl.Enable( gl.BLEND );
    gl.BlendFunc( gl.ONE, gl.ONE ); -- This produces additive blending
    
    
    -- DRAW SCENE --
    function Draw()
      gl.Clear( gl.COLOR_BUFFER_BIT )
    
      -- Draw the triangles
      for i=0, numTris, 1 do
        gl.LoadIdentity()
        gl.Translate( triangles[i].x, triangles[i].y, -16 )
        gl.Scale( triangles[i].s, triangles[i].s, triangles[i].s )
        gl.Rotate( triangles[i].r, 1, 0, 0 ) -- X-axis
        gl.Rotate( triangles[i].r, 0, 1, 0 ) -- Y-axis
        gl.Rotate( triangles[i].r, 0, 0, 1 ) -- Z-axis
    
        gl.Begin( gl.TRIANGLES )
    		gl.Color(1,0,0,1)
    		gl.Vertex(-1,1,0)
    		gl.Color(0,1,0,1)
    		gl.Vertex(1,1,0)
    		gl.Color(0,0,1,1)
    		gl.Vertex(1,-1,0)
    		gl.Color(1,1,1,1)
    		gl.Vertex(-1,-1,0)
        gl.End()
      end
    
      -- Do the blur!
      factor = 0.11 -- Lower factor = more blur
      gl.Accum( gl.MULT, 1.0 - factor ) -- Multiply the content in the accum buffer by 1 - factor
      gl.Accum( gl.ACCUM, factor ) -- Multiply the content in the color buffer by factor and add it to the accum buffer
      gl.Accum( gl.RETURN, 1.0 ) -- Return the content of the accum buffer to the color buffer
    
      -- Force execution of all gl commands
      gl.Flush()
    end
    
    
    -- UPDATE TRIANGLES --
    function UpdateTris()
      for i=0, numTris, 1 do
        -- Update X position and flip X velocity if triangle is out of boundaries
        triangles[i].x = triangles[i].x + triangles[i].vx
        if triangles[i].x < -10 then triangles[i].vx = -triangles[i].vx end
        if triangles[i].x >  10 then triangles[i].vx = -triangles[i].vx end
    
        -- Update Y position and flip Y velocity if triangle is out of boundaries
        triangles[i].y = triangles[i].y + triangles[i].vy
        if triangles[i].y < -10 then triangles[i].vy = -triangles[i].vy end
        if triangles[i].y >  10 then triangles[i].vy = -triangles[i].vy end
    
        -- Update rotation
        triangles[i].r = triangles[i].r + triangles[i].rs
      end
    end
    Which makes rainbow/plasma and was based off the older code. Now it just glitches but im not sure on the code which needs updating to fix it because it used to work great.

  3. #93
    Clicker Multimedia Fusion 2

    Join Date
    Nov 2009
    Location
    This side of the equator
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Texture object ( public beta )

    Atom: The latest base object build is not compatible with earlier builds, try copying the Lua code from your example and past it into the new additive blending example, it should work then.

    All people who have trouble with the .net examples: What happens? Is the OpenGL window just black? If you open up the script editor and click the compile button do you get any error messages?

  4. #94
    Clicker Multimedia Fusion 2
    Retriever2's Avatar
    Join Date
    Jun 2006
    Location
    United States
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Texture object ( public beta )

    It appears to display whatever garbage was last in video memory.

    When I try to compile it I get "Metadata file 'Tao.OpenGl.dll' could not be found".

  5. #95
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Texture object ( public beta )

    you need to include the examples with the opengl dll

    its in the examples/OpenGL/ folder

  6. #96
    Clicker Multimedia Fusion 2
    Retriever2's Avatar
    Join Date
    Jun 2006
    Location
    United States
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Texture object ( public beta )

    It is in the same folder as Tao.OpenGl.dll.

  7. #97
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Texture object ( public beta )

    Quote Originally Posted by Min
    Atom: The latest base object build is not compatible with earlier builds, try copying the Lua code from your example and past it into the new additive blending example, it should work then.
    Well i tried this before but i still have problems, basically i see it working in the background but there is black squares over it now. Im not sure whats wrong with it so i was thinking some of the code would need updating maybe.

    If others try the code posted does it display ok? Maybe it's my computer or something, the first version did a similar thing with the examples but a later release fixed that and i could see them ok after. I can see all other XLua examples fine though and this used to work perfectly but now copying it over gives me glitches.

  8. #98
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Texture object ( public beta )

    Quote Originally Posted by Min
    All people who have trouble with the .net examples: What happens? Is the OpenGL window just black? If you open up the script editor and click the compile button do you get any error messages?
    Yes this is what happened i just saw black, it is really odd though because now they are working fine again. Basically all i did that is different is press the compile button to test and then when i pressed to run the frame i saw it again. I also only did this for 1 example and it fixed them all but i remember they were all just showing black screens before.

    Not sure if this is why but for me they are working fine again now, it's just that XLua code i posted that is broken but everything else is working.

  9. #99
    Clicker Multimedia Fusion 2

    Join Date
    Nov 2009
    Location
    This side of the equator
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Texture object ( public beta )

    Seems like the .net example problem is due to the .net object not being able to locate the .dll. <-- Min stating the obvious.
    It's a long shot but try placing the .dll in the MMF folder and the data/runtime folder as well.

    Atom: Try adding the following right after gl.ClearColor();
    Code:
    gl.ClearAccum( 0, 0, 0, 1 ) -- Set accum buffer clear values ( r, g, b, a )
    gl.Clear( gl.ACCUM_BUFFER_BIT ) -- Clear the accum buffer once before using

  10. #100
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Texture object ( public beta )

    I just had another idea for the texture bank object, i have no idea if it is even possible though but if it is then it would be really amazing.

    Basically the idea is to use MMF HWA effects on the image/texture and apply them to 2d stuff for object surfaces or whatever in OpenGL. I know you can have shaders in OpenGL format which are similar and could maybe write all of them anyway but if it could connect to the default bank of effects MMF uses then this would be really great. Im thinking if this is possible you could then even use OpenGL shaders/fx with that also on the object/scene but at the same time have the textures used with interactive MMF HWA effects which would be very powerful.

    Having a effects/shader bank you can select effects from and apply to things would be a great idea also for when that type of stuff is added. Preset type options is also a nice idea for anything like that as they save loads of time.

    So yeah this might not even be possible but just a idea that i had, if it is though it would amazing. If not though im guessing there could be a similar system for OpenGL stuff maybe where you could code effects/shaders and share them to load in projects which would be cool.

    ----

    Edit -

    Quote Originally Posted by Min
    Atom: Try adding the following right after gl.ClearColor();
    Code:
    gl.ClearAccum( 0, 0, 0, 1 ) -- Set accum buffer clear values ( r, g, b, a )
    gl.Clear( gl.ACCUM_BUFFER_BIT ) -- Clear the accum buffer once before using
    Thanks, that seems to have fixed it

Page 10 of 11 FirstFirst ... 8 9 10 11 LastLast

Similar Threads

  1. Stretching OpenGL Base?
    By brawltaunts22 in forum Hardware Accelerated Runtime
    Replies: 8
    Last Post: 7th September 2011, 03:20 PM
  2. Minimap Object - Public Beta
    By DanielRehn in forum Extension Development
    Replies: 54
    Last Post: 3rd January 2009, 02:04 PM
  3. OpenGL object (new public beta)
    By Zyx in forum Extension Development
    Replies: 43
    Last Post: 15th December 2008, 05:21 PM
  4. New extension: OpenGL object (public beta 1)
    By Zyx in forum Extension Development
    Replies: 99
    Last Post: 11th December 2008, 11:00 PM
  5. Minimap Object - Public Beta 3
    By DanielRehn in forum Extension Development
    Replies: 26
    Last Post: 9th February 2008, 01:29 AM

Posting Permissions

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