Jump to content

shadmar

Members
  • Posts

    3,618
  • Joined

  • Last visited

Everything posted by shadmar

  1. Sqrt in lua can be done like this : math.sqrt(some number) or (some number)^0.5
  2. You should look in the Leadwerks.log file Editor folder. Might be an error related in there, maybe you don't have openAL installed, or your gpu isn't supported.
  3. True, just saying you miss out on some basic stuff skipping forward rendering
  4. If you want to hack in your own fog, add this to the bottom of all fragment shaders you use just before } to add fog. vec4 fog=vec4(1,1,1,0.05); // R,G,B,strength #define LOG2 1.442695 float z = gl_FragCoord.z / gl_FragCoord.w; float fogFactor = clamp(exp2(-fog.w*fog.w*z*z*LOG2),0.0,1.0); gl_FragColor = mix(vec4(fog.xyz,1.0), gl_FragColor, fogFactor); For terrain : terrain.shader, just before gl_FragData[0] = outcolor; add : vec4 fog=vec4(1,1,1,0.05); // R,G,B,strength #define LOG2 1.442695 float z = gl_FragCoord.z / gl_FragCoord.w; float fogFactor = clamp(exp2(-fog.w*fog.w*z*z*LOG2),0.0,1.0); outcolor = mix(vec4(fog.xyz,1.0), outcolor, fogFactor); A more elegant way would be to add vec4 fog as a uniform and send color and density from your app using SetVec4 EDIT: sorry Andy if I'm also derailing your post.
  5. Would be great for physics if you hate bouncing. (like me)
  6. Forward rendering is the place to start, in deferred you miss all the fun with lighting and transparency is much more difficult.
  7. Ah physics performance was much better without shadows, thanks. The shadow performance is quite an impact then.
  8. No issue at your end, just variables (uniforms) are sendt to the shader, but the shader doesn't use it (or doesn't have it registered because it doesn't need it) Last 3 are varyings declared as output in vertex shader but fragment does not have them for input (doesn't need them proabably). (I can't see them on windows)
  9. That's probaly uniforms sendt to a shader which doesn't have it.
  10. Ah sorry here is it exported version (added to top post)
  11. I was working on my joint editor and built a simple car to test. (it can go back and forward using the UP/DOWN keys, WASD for camera) When wheels hit the ground I go from 400 to 18 fps, which seem terrible. When the wheels are at rest it goes up to 400 ish again. Here is my full test project including the car :
  12. I might have a joint editor to go aswell. Stlll some bugs in ball joints to be worked out.
  13. Yeah it's annoying when texture are skewed once you move CSG brushes.
  14. If you test ball joints they are wierd According to the docs it should be SetLimits(cone,twist), however cone seems to be set in the last parameter. And twist doesn't seem to work, however setting a high value, seems to break cone.? Test : Copy/paste into any App.lua camera=Camera:Create() camera:SetPosition(0,2,-5) ground = Model:Box(20,1,20) local shape=Shape:Box(0,0,0,0,0,0,20,1,20) ground:SetShape(shape) ground:SetMass(0) box1 = Model:Box() box1:SetPosition(0,1.5,0) box1:SetColor(1,0,0) local shape=Shape:Box() box1:SetShape(shape) box1:SetMass(20) box2=box1:Instance() box2:SetColor(0,1,0) box2:SetPosition(0,3,0) box2:SetMass(1) cone=0 twist=45 joint=Joint:Ball(0,2,0,box1,box2) joint:SetLimits(cone,twist) joint:EnableLimits() box2:AddTorque(200,200,200)
  15. Attempt to call method Pick (a nil value). I guess it wasn't exposed to lua.
  16. Then again joint:EnableLimits() helps...
  17. Not sure if it was before, or not implemented yet. Simple test : Create a terrain with some simple elevation Add this to App:Start() --Create a sphere to indicate where the pick hits local picksphere = Model:Sphere() picksphere:SetColor(1.0,0.0,0.0) --picksphere:SetPickMode(Entity.SpherePick) local pickradius = 0.1 picksphere:SetScale(pickradius*2.0) for x=0,1000 do local pickinfo = PickInfo() x,z = Math:Random(-100,100),Math:Random(-100,100) if (self.world:Pick(Vec3(x,100,z),Vec3(x,0,z),pickinfo,pickradius,true)) then local ps = picksphere:Instance() ps:SetPosition(pickinfo.position) end end
  18. I noticed joints doesn't take limits anymore when created (argument doesn't exists) So I tried to use SetLimits() ..But it seems to be ignored not matter the joint type. Simple test for hinge : box=Model:Box() box:SetPosition(0,11,0) box:SetMass(1) local shape = Shape:Box(0,0,0, 0,0,0, 1,1,1) box:SetShape(shape) box2=box:Instance() box2:SetMass(0) box2:SetPosition(1,11,0) local joint = Joint:Hinge(0.5,11,0,0,0,1,box,box2) joint:SetLimits(-2,2)
  19. You can texture scale the entire object now. Select object via perspective view (in order to select it with all it's children), click Select face and scale texture, they will scale relatively. If only one object do the same or ctrl click each face. You can also move,rot,scale with all childs by selecting it via perspective view. Not so smooth, I wish I could shift-click parent in scenetab to select parent with all it's children. I agree on scaling all axis would be nice.
  20. If you save this as a prefab with materials, you can just have people generate the lightmap themselves after it's loaded. Just rename the top one to break the prefab before doing so, then it will accept lightmaps.
  21. You can also hack the shader it by changeing const float magicnumber = 0.646446609 / 2.0; to something like : const float magicnumber = 0.646446609 / 0.5;
×
×
  • Create New...