Jump to content

ChrisMAN

Members
  • Posts

    174
  • Joined

  • Last visited

Recent Profile Visitors

12,671 profile views

ChrisMAN's Achievements

Newbie

Newbie (1/14)

27

Reputation

  1. ok. debug off. vsync off. i ran around in the main room for like 5 minutes and started with 100fps and ended with 60fps smells like a leak.
  2. There is something kind of off where it is feeling artificially choppy. I am running off of a nvidia 670 ftw and am getting 40-50 fps. Something is definitely wrong unless this is supposed to supersede The Witcher 2.
  3. Josh will you expose LuaJITs ffi package to LE3? It should just work out of the box but le does something funny i don't understand. I consider ffi to be superior workflow to creating bindings in many cases.
  4. When the JIT can figure it out lua is very fast. I know for a fact that i have gotten burned by simple things like exiting a function early. Microbenchmarks put it at 70-80% native C. I would be curious to see what the lua profiler says. https://gist.github.com/perky/2838755
  5. I have been horsing around with sdl and the likes trying to figure out how this stuff works. Here is to hoping for abandonment.
  6. i dont get how you were able to blend 2 materials. can you reiterate how you did that? very cool stuff.
  7. If what i remember hearing is correct you can attach post processing directly to the camera.
  8. I would be very interested in hearing if any one has gotten free type integrated with leadwerks 2.5.
  9. I don't know much about opengl but once i started thinking of buffers as an array of memory addresses on the video card things started to make more sense. When you copy from the buffer you are still just copying memory addresses so if you modify the buffer after a copy, the copy is affected as well. Here is the trick to get the transparent buffer: SetBlend(1) SetColor(Vec4(0,0,0,0)) ClearBuffer() in summary set the color before clearing the buffer. the buffer's background will inherit the current color.
  10. yes that is what i was doing. my gui framework i wrote handled it so i don't have a nice clean snippet of how to do it. create a full sized buffer copy the color buffer use DrawImage to draw just copied texture to the backbuffer *protip be mindful of your color during this whole thing. it is much like setworld. if you don't manage it... it will manage you!!! as far as positioning goes i positioned everything using left, right, top, bottom. right and bottom subtracted the width of the element to that it could cleanly snap to the side/bottom of an element. again the gui tool i wrote handle this for me. i also used a combination of horizontal/vertical centering for things that would go in the middle of the screen. i find using these relative coordinates solves the majority of ui issues. if you can't get that to work i can cook something up.
  11. I had been using leadwerks buffers to downsample eveything. I havn't tested the extremes though :| I could see it falling apart after 30%
  12. there is a pattern from functional programming called partial application which is kind of interesting for message handlers
  13. never done it. just using my magic google powers. for ltp/serial on linux you write to a file. on windows its WinApi there is libusb for usb stuff.
  14. Here is a character animation template i wrote for the leadwerks community project in lua https://gist.github.com/friesencr/4743009 require("scripts/class") require("scripts/math/math") require("Scripts/constants/engine_const") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) local animation_data = { walk = { start = 50, frames = 23, multiplier = 1 }, idle = { start = 0, frames = 44, multiplier = 1 }, strafe = { start = 75, frames = 117 - 75, multiplier = 3 }, run = { start = 125, frames = 142 - 125, multiplier = 1 }, run_strafe = { start = 75, frames = 117 - 75, multiplier = 5 }, jump = { start = 150, frames = 176 - 150, multiplier = 1 }, land = { start = 210, frames = 214 - 210, multiplier = 1 } } local current_frame local animation_state local animation_start_time = AppTime() local current_animation = animation_data['idle'] function object:Update() local ca = current_animation local time = AppTime() - animation_start_time local frame = (( time / 60 ) % (ca.frames/ca.multiplier)) * ca.multiplier + ca.start self.model:Animate(frame, 0.2,0,1) end function SetAnimationState(state) animation_state = state animation_start_time = AppTime() current_animation = animation_data[state] end function object:ReceiveMessage(message, extra) if message == 'idle' then object:Idle() elseif message == 'walk' then object:Walk() elseif message == 'run' then object:Run() elseif message == 'jump' then object:Jump() elseif message == 'land' then object:Land() elseif message == 'strafe' then object:Strafe() elseif message == 'run_strafe' then object:RunStrafe() end end function object:Walk() if animation_state ~= 'walk' then SetAnimationState('walk') end end function object:Idle() if animation_state ~= 'idle' then SetAnimationState('idle') end end function object:Run() if animation_state ~= 'run' then SetAnimationState('run') end end function object:Strafe() if animation_state ~= 'strafe' then SetAnimationState('strafe') end end function object:RunStrafe() if animation_state ~= 'strafe' then SetAnimationState('strafe') end end function object:Land() if animation_state ~= 'land' then SetAnimationState('land') end end function object:Jump() if animation_state ~= 'jump' then SetAnimationState('jump') end end end
  15. Don't forget to set the color to 0,0,0,0 before clearing the buffer.
×
×
  • Create New...