Jump to content

TylerH

Members
  • Posts

    525
  • Joined

  • Last visited

Posts posted by TylerH

  1. Honestly I don't know. Everything kind of followed an Update/Render generic command set in the main loop, and the individual programmer of that portion of the component was responsible for the internal logic.

     

    I would have to take a look to see, so give me a little while.

  2. That is actually interesting. I don't recall anything that was designed to change the player's texture based on rotation, but I *do* remember the version of the engine we were using suffered from some horrible bugs that did things like that, and squishing the scene with more than 1 light, and such.

     

    Might be best to see how it runs on the latest engine, but great that you were able to get the full on program to run :)

  3. I have a realtime "cubemap" (of a sort) as an object scripted model.

    except I am hacking it by having a different material on each face, rendering to each face's buffer, and then setting the resulting colorbuffer to each face's material... effectively creating a "cubemap". Using the framework camera for the buffer renders gives it a nice crystal clear reflection and all of the nice framework effects rendered... but its a fps killer doing 6 faces. For actual use in a game, you could just use a normal camera for the render which will give a greater fps boost.

     

    Very cool. Care to share how you did that?

  4. After speaking with Josh, though he is busy, I think I am doing it the proper way (yet it still isn't working)

     

    -- Create cubemap camera
    cubemapcamera = CreateCamera()
    
    -- Create cubemap
    cubemap = CreateCubemap(512,512)
    
    -- Create cubemap 'gbuffer'
    cubemapbuffer = CreateBuffer(512,512,1+2+4+8)
    
    -- Create six buffers to render each cube face to
    cubemapbufferpx = CreateBuffer(512,512,1+2+4+8)
    cubemapbuffernx = CreateBuffer(512,512,1+2+4+8)
    cubemapbufferpy = CreateBuffer(512,512,1+2+4+8)
    cubemapbufferny = CreateBuffer(512,512,1+2+4+8)
    cubemapbufferpz = CreateBuffer(512,512,1+2+4+8)
    cubemapbuffernz = CreateBuffer(512,512,1+2+4+8)
    
    -- Bind each buffer to a face of the cubemap
    SetColorBuffer(cubemapbufferpx, cubemap, 0, 0) -- positive x
    SetColorBuffer(cubemapbuffernx, cubemap, 0, 1) -- negative x
    SetColorBuffer(cubemapbufferpy, cubemap, 0, 2) -- positive y
    SetColorBuffer(cubemapbufferny, cubemap, 0, 3) -- negative y
    SetColorBuffer(cubemapbufferpz, cubemap, 0, 4) -- positive z
    SetColorBuffer(cubemapbuffernz, cubemap, 0, 5) -- negative z
    
    Then during rendering:
    
    -- Realtime cubemap
    CameraProjMode(camera, 0) -- Disable player cam
    PositionEntity(cubecamera,mesh.position) -- Position cubemap camera at the center of the mesh
    CameraProjMode(cubecamera, 1) -- Enable cubemap camera
    
    --Render Positive X
    SetBuffer(cubemapbuffer)
    RotateEntity(cubecamera, Vec3(0, 90, 0))
    world:Render()
    SetBuffer(cubemapbufferpx)
    world:RenderLights(cubemapbuffer)
    
    -- Render Negative X
    SetBuffer(cubemapbuffer)
    RotateEntity(cubecamera, Vec3(0, -90, 0))
    world:Render()
    SetBuffer(cubemapbuffernx)
    world:RenderLights(cubemapbuffer)
    
    --Render Positive Y
    SetBuffer(cubemapbuffer)
    RotateEntity(cubecamera, Vec3(-90, 0, 0))
    world:Render()
    SetBuffer(cubemapbufferpy)
    world:RenderLights(cubemapbuffer)
    
    -- Render Negative Y
    SetBuffer(cubemapbuffer)
    RotateEntity(cubecamera, Vec3(90, 0, 0))
    world:Render()
    SetBuffer(cubemapbufferny)
    world:RenderLights(cubemapbuffer)
    
    --Render Positive Z
    SetBuffer(cubemapbuffer)
    RotateEntity(cubecamera, Vec3(0, 0, 0))
    world:Render()
    SetBuffer(cubemapbufferpz)
    world:RenderLights(cubemapbuffer)
    
    --Render Negative Z
    SetBuffer(cubemapbuffer)
    RotateEntity(cubecamera, Vec3(0, -180, 0))
    world:Render()
    SetBuffer(cubemapbuffernz)
    world:RenderLights(cubemapbuffer)
    
    CameraProjMode(cubecamera, 0) -- Disable cubemap camera
    CameraProjMode(camera, 1) -- Enable player camera
    
    SetShader(GetMaterialShader(mesh.material))
    BindTexture(cubemap,0) -- Bind cubemap to material
    SetShader(nil)
    
    -- render world to GBuffer and draw to BackBuffer as usual.
    

     

    This is the result (all 6 individual buffers are rendered to fine, but the cubemap doesn't seem to be getting rendered to):

    realtimecubema.png

     

    Full script is attached.

    cubemap.lua

  5. After speaking with Josh, though he is busy, I think I am not doing it the proper way (yet it still isn't working)

     

    -- Create cubemap camera
    cubemapcamera = CreateCamera()
    
    -- Create cubemap
    cubemap = CreateCubemap(512,512)
    
    -- Create cubemap 'gbuffer'
    cubemapbuffer = CreateBuffer(512,512,1+2+4+8)
    
    -- Create six buffers to render each cube face to
    cubemapbufferpx = CreateBuffer(512,512,1+2+4+8)
    cubemapbuffernx = CreateBuffer(512,512,1+2+4+8)
    cubemapbufferpy = CreateBuffer(512,512,1+2+4+8)
    cubemapbufferny = CreateBuffer(512,512,1+2+4+8)
    cubemapbufferpz = CreateBuffer(512,512,1+2+4+8)
    cubemapbuffernz = CreateBuffer(512,512,1+2+4+8)
    
    -- Bind each buffer to a face of the cubemap
    SetColorBuffer(cubemapbufferpx, cubemap, 0, 0) -- positive x
    SetColorBuffer(cubemapbuffernx, cubemap, 0, 1) -- negative x
    SetColorBuffer(cubemapbufferpy, cubemap, 0, 2) -- positive y
    SetColorBuffer(cubemapbufferny, cubemap, 0, 3) -- negative y
    SetColorBuffer(cubemapbufferpz, cubemap, 0, 4) -- positive z
    SetColorBuffer(cubemapbuffernz, cubemap, 0, 5) -- negative z
    
    Then during rendering:
    
    -- Realtime cubemap
    CameraProjMode(camera, 0) -- Disable player cam
    PositionEntity(cubecamera,mesh.position) -- Position cubemap camera at the center of the mesh
    CameraProjMode(cubecamera, 1) -- Enable cubemap camera
    
    --Render Positive X
    SetBuffer(cubemapbuffer)
    RotateEntity(cubecamera, Vec3(0, 90, 0))
    world:Render()
    SetBuffer(cubemapbufferpx)
    world:RenderLights(cubemapbuffer)
    
    -- Render Negative X
    SetBuffer(cubemapbuffer)
    RotateEntity(cubecamera, Vec3(0, -90, 0))
    world:Render()
    SetBuffer(cubemapbuffernx)
    world:RenderLights(cubemapbuffer)
    
    --Render Positive Y
    SetBuffer(cubemapbuffer)
    RotateEntity(cubecamera, Vec3(-90, 0, 0))
    world:Render()
    SetBuffer(cubemapbufferpy)
    world:RenderLights(cubemapbuffer)
    
    -- Render Negative Y
    SetBuffer(cubemapbuffer)
    RotateEntity(cubecamera, Vec3(90, 0, 0))
    world:Render()
    SetBuffer(cubemapbufferny)
    world:RenderLights(cubemapbuffer)
    
    --Render Positive Z
    SetBuffer(cubemapbuffer)
    RotateEntity(cubecamera, Vec3(0, 0, 0))
    world:Render()
    SetBuffer(cubemapbufferpz)
    world:RenderLights(cubemapbuffer)
    
    --Render Negative Z
    SetBuffer(cubemapbuffer)
    RotateEntity(cubecamera, Vec3(0, -180, 0))
    world:Render()
    SetBuffer(cubemapbuffernz)
    world:RenderLights(cubemapbuffer)
    
    CameraProjMode(cubecamera, 0) -- Disable cubemap camera
    CameraProjMode(camera, 1) -- Enable player camera
    
    SetShader(GetMaterialShader(mesh.material))
    BindTexture(cubemap,0) -- Bind cubemap to material
    SetShader(nil)
    
    -- render world to GBuffer and draw to BackBuffer as usual.
    

     

    This is the result (all 6 individual buffers are rendered to fine, but the cubemap doesn't seem to be getting rendered to):

    realtimecubema.png

     

    Full script is attached.

    cubemap.lua

  6. I have attempted it in C# and Lua and neither have worked. Lua is the only language other than Blitzmax with CreateCubemap exposed, and I still can't get it to work.

     

    Attached is the code for both versions, as well as the cubemap.mat file. Can everyone please take a look at this? We could gain some great features and eye candy if this were to be working properly.

    cubemap.lua

    cubemap.mat.txt

    Program.cs.txt

  7. Ah yes, SetColorBuffer is what you would use.

     

    EDIT: You would create the texture you intend to use as the cubemap just as you would any other texture. Then for each cube face direction, call SetColorBuffer(texture, cubeface), render that direction. Then pass your texture to the shader.

  8. I am mainly consolidating some existing requests by Masterxilo, combined with some requests of mine because these are 100% crucial to having a fully OO wrapper and framework for Leadwerks. These should have been in from the beginning, and are trivial to add (I could add them to the DLL source in a few hours).

     

    These are the functions that need added (alphabetical by class):

    • Body
    • GetBodyGravityMode
    • GetBodyDamping
    • GetBodyMassCenter
    • GetBodyElasticity
    • GetBodySoftness
    • GetBodyFriction
    • GetBodyBuoyancyMode
    • GetBodyStepMode
    • GetBodyTorque
    • GetBodyForce
    • Camera
    • GetCameraClearColor
    • GetCameraProjMode
    • GetCameraZoom
    • GetCameraClearMode
    • Corona
    • GetCoronaRadius
    • Emitter
    • GetEmitterVelocity
    • GetEmitterAcceleration
    • GetEmitterArea
    • GetEmitterRadius
    • GetEmitterRotationSpeed
    • GetEmitterWaver
    • GetEmitterCycleMode (this is set in the constructor)
    • GetEmitterLifeTime (this is set in the constructor)
    • SetEmitterLifeTime (would be nice to be able to change this after creation)
    • Entity
    • GetEntityColor
    • GetEntityViewRange
    • GetEntityOcclusionMode
    • GetEntityShadowRange
    • GetEntityShadowMode
    • SetEntityQuat (this would make IK much more efficient)
    • Joint
    • GetHingeJointLimits
    • GetSliderJointLimits
    • GetBallJointLimits
    • GetJointStiffness
    • GetJointCollisionMode
    • Light
    • GetLightFalloff
    • GetLightConeAngles
    • GetShadowmapSize
    • GetShadowOffset
    • GetShadowSoftness
    • GetShadowDistance
    • Shader
    • GetShaderXXX (for all SetShaderXXX commands)
    • Source
    • GetSourceVolume
    • GetSourcePitch
    • GetSourceRange
    • GetSourcePosition
    • Terrain
    • GetTerrainTexture
    • GetTerrainTextureScale
    • GetTerrainTextureRotation
    • GetTerrainMappingMode
    • GetTerrainTextureConstraints
    • Vehicle
    • SetTireMatrix
    • World
    • GetPhysicsQuality
    • GetWorldGravity
    • GetWorldSize
    • GetFluidPlane
    • GetFluidViscosity
    • GetFluidDensity
    • GetEntities
    • GetMeshes
    • GetModels
    • GetEmitters
    • GetTerrains
    • GetCoronas
    • GetBodies
    • GetListeners
    • GetCameras
    • GetPivots
    • GetJoints
    • GetControllers
       

    • Upvote 2
  9. Simply as the description says...

     

    If I do a line pick, entity pick, or camera pick, and it indeed hits something, does this "collision", or more properly labeled "hit", invoke and register as a collision that I can detect and mess with using the entity collision callback? The purpose for this is simply to more easily work on the game logic that allows an entity to know when it is hit with a raycast (used for weapons, bullets, explosions, etc. in my game framework).

×
×
  • Create New...