Jump to content

shadmar

Members
  • Posts

    3,618
  • Joined

  • Last visited

Everything posted by shadmar

  1. Leadwerks can import fbx model format. So yes you can, but you will need to convert obj to fbx and then import.
  2. Leadwerks2 supported this, but I don't think this will work in Leadwerks3 until newtons vehicles module is exposed or some sort of spring / dampening is exposed.
  3. Current physics implemneted are highly basic functionality. If we had springs, you could probably make a basic car, wihout springs it won't work.
  4. buffer is the default buffer (which only allows disable/enable, but since deoth,normals and diffuse are already provided it's ok. camera is the camera which will render the effect, can be viewport camera or FPSplayer runtime or the camera:AddPostEffect() you have done in code... so yes it's the camera rendering the effect.
  5. If pickinfo.normal differs alot from 0,1,0 it's not a floor. You could use that information to disallow wall clicking.
  6. diffuse,depth, and normal are textures you can sample in your shader.
  7. It works : http://steamcommunity.com/sharedfiles/filedetails/?id=291076598
  8. Thanks! dir = Vec3(light.mat.k.x,light.mat.k.y,light.mat.k.z):Normalize() is accurate and just what was needed!
  9. Attributes (x,y,z,w) are not exposed in the Quat class.
  10. Thanks both. virtual Quat GetQuaternion(const bool global=false);//lua seem exposed in the header, I will test.
  11. If I want the sunlights rotation converted into a direction vector, how can I do this in lua?
  12. I dont really know what the terrainsize is after loading a map. Some sort of indicator would be nice.
  13. The waterprefab is kind of outdated and hard to use I will remove it. I was suppose to make a new one, but was kind of hoping klepto to put his in the workshop instead.
  14. You have to sample the textures before they are usable. So line 88 should read something like : vec4 outcolor = ambientmaterial + df * texture(texture0,ex_texcoords0) + sf * texture(texture2,ex_texcoords0); There is a toon shader ala borderlands style already with the game engine. (Post process).
  15. --Scale of box has to be less or equal to 1, you can scale up after function Script:sphereit(x,y,z) sx = x * math.sqrt(1.0 - (y*y*0.5) - (z*z*0.5) + (y*y*z*z/3.0)); sy = y * math.sqrt(1.0 - (z*z*0.5) - (x*x*0.5) + (z*z*x*x/3.0)); sz = z * math.sqrt(1.0 - (x*x*0.5) - (y*y*0.5) + (x*x*y*y/3.0)); return sx,sy,sz end Example usage on a 1x1x1 box mesh (has to be abit tesselated to have enough vertices to transform) function Script:Start() surface=self.entity:GetSurface(0) for v=0,surface:CountVertices()-1 do surface:SetVertexColor(v,v/1000,1000-v,v/1000,1) vpos = surface:GetVertexPosition(v) x,y,z = self:sphereit(vpos.x,vpos.y,vpos.z) surface:SetVertexPosition(v,Vec3(x,y,z)) end surface:UpdateNormals(true,0.01,180) end
  16. -- This will create an inverted sphere, meant for a skydome or similar function Script:CreateSphere(latitudeBands, longitudeBands, radius) local model = Model:Create() local surface = model:AddSurface() for latNumber=0,latitudeBands,1 do local theta = latNumber * math.pi / latitudeBands local sinTheta = math.sin(theta) local cosTheta = math.cos(theta) for longNumber = 0,longitudeBands,1 do local phi = longNumber * 2 * math.pi / longitudeBands; local sinPhi = math.sin(phi); local cosPhi = math.cos(phi); local x = cosPhi * sinTheta; local y = cosTheta; local z = sinPhi * sinTheta; local u = 1 - (longNumber / longitudeBands); local v = 1 - (latNumber / latitudeBands); surface:AddVertex(radius * x, radius * y, radius * z, x, y, z, u, v) end end for latNumber = 0,latitudeBands-1,1 do for longNumber = 0,longitudeBands-1,1 do local first = (latNumber * (longitudeBands + 1)) + longNumber; local second = first + longitudeBands + 1; surface:AddTriangle(second,second + 1,first + 1) surface:AddTriangle(first + 1,first,second) end end model:UpdateAABB(Entity.LocalAABB) model:UpdateAABB(Entity.GlobalAABB) return model end
  17. I dont know, I only have the demo version of 2. (which allows exports too) infact not sure what the demo limititation is. Here are my shaders which will take a global colormap and normalmap in layer0 (normalmap needs Y inverted after import) Set Scale to 1 for 2048 terrain, 2 for 4096 terrain. Terrain.zip
  18. Kind of hacked it in the clipmap shader, but would be nice to have as a supported option some day.
  19. Maybe ldd or ld ./Leadwerks will reveal something too.
  20. Give me a textureslot and an uvmap which covers the entire terrain (not tiled). I want to make maps like this and just need one more texture to tonemap everything. Something like final megatexture.rgb*texture(tonemap,strecheduvmap).rgb; Megatexture for the details as now ofcource. And put those in the workshop. We could use some terrains in the workshop too, like this.
  21. Haven't tried Gentoo, but this works on Mint 16 (look post by Guppy), and might be of some help (fixes the menu crash) : http://www.leadwerks.com/werkspace/topic/9254-mint-16-ubuntu-1310/
×
×
  • Create New...