Jump to content

Josh

Staff
  • Posts

    24,625
  • Joined

  • Last visited

Everything posted by Josh

  1. That's normal. Unless you want a separate buffer/pass for every single z-sorted object, it's not possible to have refraction on top of refraction. All particles are rendered in the same pass, even if they aren't using a refraction effect.
  2. Josh

    Input Console

    File Name: Input Console File Submitter: Josh File Submitted: 01 Jan 2010 File Category: Lua Scripts Here's a basic console for typing commands into your game. Click here to download this file
  3. Josh

    Networking

    I just got a basic networking example working with Lua. I'll post it soon. I was wondering if anyone was actively using the networking commands, and if you have any videos, demos, or feedback. I am very interested in getting a playable networked game running.
  4. I don't think this key exists on a Mac.
  5. Open Leadwerks Engine SDK\BMX\Framework\Framework.bmx in notepad. If the field "main" is capitalized, you have a problem. Change the field to lower-base "main" and regenerate your glue functions. After I performed these steps, your program ran fine for me. http://blitzmax.com/Community/posts.php?topic=88427
  6. Not only does heathaze not work, but setting the global "fw" variable in Lua causes your scene to not render lighting.
  7. Can you post a demo? I did a test in C++ and it worked fine. Shouldn't be any difference.
  8. No, I think we are through any changes that will occur.
  9. Try this for the firepit script and it will work: require("scripts/class") local class=CreateClass(...) class.sound=LoadSound('abstract::campfire_01_15.wav') function class:CreateObject(model) local object=self.super:CreateObject(model) object.model.aabb.x0=-5 object.model.aabb.x1=5 object.model.aabb.y0=-5 object.model.aabb.y1=5 object.model.aabb.z0=-5 object.model.aabb.z1=5 --Create light object.light=CreatePointLight(4,model) object.light:SetColorf(1,0.6,0.25,1,1) object.light:SetPositionf(0,1.2,0,0) object.light:SetShadowOffset(0,0.91,0) --Create emitters if fw~=nil then SetWorld(fw.transparency.world) object.heathaze=CreateEmitter(10,4500,Vec3(0,1,0),0,object.model) object.heathaze:SetPositionf(-136,52,-662,0) object.material_heathaze=LoadMaterial('abstract::heathaze.mat',0) object.heathaze:Paint(object.material_heathaze,0) object.heathaze:SetRadius(0.25,0.25) object.heathaze:SetWaver(0) object.heathaze:SetOrder(1,0) object.heathaze:SetVelocity(Vec3(0,0.375,0),Vec3(0,0.05,0)) object.heathaze:SetRotationSpeed(0.01) object.heathaze:SetArea(Vec3(0.2,0.0,0.2)) object.heathaze:SetPositionf(0,0.25,0,0) object.fire=CreateEmitter(25,750,Vec3(0,1,0),0,object.model) object.fire:SetPositionf(0,0.25,0,0) object.fire:Paint(LoadMaterial('abstract::fire.mat'),0) object.fire:SetRadius(0.4,0.1) object.fire:SetColorf(0.2,0.2,0.2,1,1) object.fire:SetWaver(1) object.fire:SetVelocity(Vec3(0,1.5,0),Vec3(0,0.05,0)) object.fire:SetRotationSpeed(0.01) object.fire:SetArea(Vec3(0.2,0.1,0.2)) object.sparks=CreateEmitter(5,800,Vec3(0,1,0),0,object.model) object.sparks:Paint(LoadMaterial('abstract::fire.mat'),0) object.sparks:SetRadius(0.01,0.01) object.sparks:SetColorf(1,0.6,0.25,1,1) object.sparks:SetVelocity(Vec3(0,1.5,0),Vec3(0.05,0.5,0.05)) object.sparks:SetRotationSpeed(0.1) object.sparks:SetArea(Vec3(0.4,0.0,0.4)) object.sparks:SetWaver(5) object.sparks:SetPositionf(0,0.25,0,0) SetWorld(fw.main.world) end --Emit fire sound if class.sound~=nil then object.model:EmitSound(class.sound,10,1,1) end --Declare initial values object.fluctuation=1.0 object.smoothedfluctuation=1.0 function object:SetKey(key,value) if key=="color" then elseif key=="intensity" then else return self.super:SetKey(model,key,value) end return 1 end --Force the bounding box to be bigger --[[function object:UpdateMatrix() object.model.aabb.x0=object.model.mat.tx-5 object.model.aabb.x1=object.model.mat.tx+5 object.model.aabb.y0=object.model.mat.ty-5 object.model.aabb.y1=object.model.mat.ty+5 object.model.aabb.z0=object.model.mat.tz-5 object.model.aabb.z1=object.model.mat.tz+5 object.model.aabb:Update() end]]-- function object:GetKey(key,value) if key=="color" then elseif key=="intensity" then else return self.super:GetKey(model,key,value) end return value end function object:Render() self.fluctuation=self.fluctuation+math.random(-100,100)/1000.0*AppSpeed() self.fluctuation=math.min(1.8,self.fluctuation) self.fluctuation=math.max(0.2,self.fluctuation) self.smoothedfluctuation=Curve(self.fluctuation,self.smoothedfluctuation,5.0/AppSpeed()) self.light:SetColorf(1.0*self.smoothedfluctuation,0.6*self.smoothedfluctuation,0.25*self.smoothedfluctuation,1,0) end end
  10. You probably mean 2.1, not 1.2.
  11. Increase the range of the directional light. The huge mountains are intersecting the near camera frustum when the shadow is rendered, resulting in the camera terrain passing in and out of the shadow.
  12. I agree it is annoying, but you can always stick with the module. I don't understand your question about OSX.
  13. I'll add a mechanism whereby you can add a postfilter effect into the renderer. Lua's OO implementation is a bit weird, but in the end you can still go entity:SetPosition(), so I am happy with it.
  14. This option is not quite ready.
  15. Josh

    POO1

    Post the obj file. It appears as if your vertices don't have three components listed: Case "v" If line.length<3 Notify "POO1" AppendFloat position,Float(line[1]) AppendFloat position,Float(line[2]) AppendFloat position,-Float(line[3])
  16. Good eyes! The StringToVec2() thing won't make any difference, but it is fixed.
  17. It will take you a few seconds to change those vec2 range parameters to floats. I agree it is annoying, but I made the change with the approach of "what will result in a better engine six months from now?".
  18. I made a small fix to the waterplane script and uploaded. The SetWaterVisibility arguments were wrong: require("scripts/class") local class=CreateClass(...) function class:InitDialog(grid) self.super:InitDialog(grid) local group=grid:AddGroup("Water") group:AddProperty("submersioncolor",PROPERTY_COLOR,"","Submersion Color") group:AddProperty("Softness",PROPERTY_FLOAT,"0,50") group:AddProperty("Visibility",PROPERTY_VEC2) group:AddProperty("Amplitude",PROPERTY_FLOAT,"0,16") group:AddProperty("WaveSpeed",PROPERTY_FLOAT,"0,10","Wave speed") group:Expand(1) end function class:CreateObject(model) local object=self.super:CreateObject(model) object.height=model.mat.ty object.submersioncolor=Vec4(0.5,0.5,0.5,1.0) object.softness=1 object.visibility=Vec2(0,20) object.amplitude=1 object.wavespeed=1 object.model:SetKey("submersioncolor","128,128,128,255") object.model:SetKey("softness","1.0") object.model:SetKey("visibility","0,20") object.model:SetKey("amplitude","1.0") object.model:SetKey("wavespeed","1.0") function object:Refresh() if fw~=nil then fw.renderer:SetWater(1) fw.renderer:SetWaterHeight(self.height) fw.renderer:SetWaterColor(self.model.color,self.submersioncolor) fw.renderer:SetWaterSoftness(self.softness) fw.renderer:SetWaterVisibility(self.visibility.x,self.visibility.y) fw.renderer:SetWaterAmplitude(self.amplitude) fw.renderer:SetWaterWaveSpeed(self.wavespeed) end end function object:UpdateMatrix() self.height=self.model.mat.ty self:Refresh() end function object:UnlockKeys(model) object:Refresh() end function object:SetKey(key,value) if key=="softness" then self.softness=tonumber(value) elseif key=="submersioncolor" then self.submersioncolor=StringToColor(value) elseif key=="visibility" then self.visibility=StringToVec2(value) elseif key=="wavespeed" then self.wavespeed=tonumber(value) elseif key=="amplitude" then self.amplitude=tonumber(value) elseif key=="position" then local t t=StringToVec3(value) self.height=t.y return self.super:SetKey(key,value) else return self.super:SetKey(key,value) end return 1 end function object:Free() local model,object self.class:RestoreDefaults() for model,object in pairs(self.class.instances) do if object~=self then object:Refresh() break end end self.super:Free() end object:Refresh() end function class:RestoreDefaults() if fw~=nil then fw.renderer:SetWater(0) fw.renderer:SetWaterHeight(0.0) fw.renderer:SetWaterColor(Vec4(1,1,1,1),Vec4(0.5,0.5,0.5,1.0)) fw.renderer:SetWaterSoftness(1.0) fw.renderer:SetWaterVisibility(Vec2(0,50)) fw.renderer:SetWaterAmplitude(1.0) fw.renderer:SetWaterWaveSpeed(1.0) end if fw.renderer.waterpatch~=nil then fw.renderer.waterpatch:SetParent(nil,1) end end function class:Free() self:RestoreDefaults() self.super:Free() end
  19. Josh

    Model request

    Blasphemy! Just kidding. The texturing looks really nice. It seems like it would fit in with a variety of scenes and not look out of place. You can make a drawer shape out of multiple objects. Each object has to be a convex hull, but you can make the phy shape out of multiple convex hulls in one obj file.
  20. I really recommend using the model name, because it is pretty redundant to have to add a classname property any time you add a new class.
  21. Nothing. A lot of the Vec2 arguments in the framework commands were redundant, because you would never have those values as Vec2's in the first place, unlike colors and positions, which often already come in a vector object. The parameters are all documented here: http://leadwerks.com/wiki/index.php?title=Framework If you do not want to mess around with this, just use the existing framewerk module, which will work fine.
  22. The problem with the SBX properties not loading is fixed in the DLL which has been uploaded. If you want the file name of a model, there is a command for that: http://leadwerks.com...odels#ModelName If you want to add a "classname" property for parsing, just open the model .ini file and add something like this: classname="light_directional" That is how it is done in SDK 2.25. I think it is easier to just rely on the model name, because then there is not an extra property to add. Instead of looking for a classname value called "light_directional" look for a file name called "light_directional" (with the file path and extension removed).
  23. It is questionable whether another instance of Lua opened in C can use the lua state created by the engine. The best bet is probably to use the Lua API declared in the engine DLL. Right now the exposed Lua commands are minimal, but I'll add more with time.
  24. Josh

    Model request

    You will need to sync before running the script. The CreateJointSlider() command was missing.
×
×
  • Create New...