Einlander
-
Posts
778 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Einlander
-
-
Do you mind posting the .shade file here? I have Shade 3d 14 and can take a look at it.
-
This would need a better script editor than we currently have. One that is capable of understanding variables strings and resources.
-
Make a copy of the model and change the material on the copy.
-
For modeling software, I also made a list of software and some thoughts about them.
-
There is always the option to make a wikibook for leadwerks. We can always use the same game idea and book structure as unity or a similar engine. This way when it needs to be updated someone can and new sections can always be added.
-
I wouldn't go that far about ATI. I only have problems with exactly 1 piece of software when it comes to ATI cards. That and any software that thinks using hardware Physx is a good idea. How is it that my 8 core 4Ghz processor and 2 R9 270x gfx cards struggling to run Borderlands 2 on max settings and max Physx? Because NVIDIA made the tools and basically told and users to f off. If you can't tell I'm bitter against NVIDIA. (got a nvidia motherboard, with NVIDIA chipsets and built in NVIDIA gfx card? Installed an ATI gfx card? Gonna have to disable hardware Physx)
-
The latest Amd Catalyst Omega drivers don't work with Leadwerks. (R9 270x 2gb)x2 crossfire
-
Thanks and holy ****! I was expecting more from bullet physics. In the thread I posted in the OP, a chunk with about 1500 triangles takes about 6ms to generate a mesh collider for. Mesh generation is always under 1ms, usually like 300 microseconds.
Are you using RigidBodys or static colliders? Make sure you did it with static colliders as those should be faster.
I don't think my CPU is that amazing either; Intel Core i7-2670QM @ 2.20GHz 4 cores (8 threads).
This does not bode well because I'm thinking about integrating Bullet physics into Unity.
Interesting, but without the exact number of triangles there's little one can do with that information.
Leadwerks only deals with triangles so the exact number would be 400^2
Also Leadwerks uses Newton physics.
-
A 200x200 grid plane takes around 20seconds to generate a collision, 100x100 is from .4 to 4 seconds.
-
You can create tiles with prebuilt waypoints. The road waypoint has a key saying its a road, the sidewalk has a waypoint saying its a sidewalk. Cars only look for car waypoints and people look for sidewalks. The complicated part is getting the car to plot a path from a location to another exclusively using waypoints.
-
That worked beautifully. I was trying to apply the texture coordinates for every single triangle individually. I also added a scaling feature.
The new function for all thoe intrested.
function Script:MakeTerrain(TerrainSize,texscale)
--texscale must be => 1
if ( (texscale == nil) == true or (texscale <= 0) == true) then texscale = TerrainSize end
local terrain = nil
terrain = Model:Create()
terrain:SetColor(0.5,0.5,0.5)
local surface = terrain:AddSurface()
-- add vertexes and uv's
System:Print("Generating Vertices")
for TerrainWidth=0 , TerrainSize do
for TerrainDepth=0 , TerrainSize do
surface:AddVertex(Vec3(TerrainWidth*self.TerrainSquareSize,0,TerrainDepth*self.TerrainSquareSize), Vec3(0,1,0),Vec2((TerrainWidth / TerrainSize)*texscale, ((TerrainDepth / TerrainSize)*texscale)*-1))
end
end
-- add triangles
System:Print("Generating faces")
trianglestrip = 0
System:Print(tostring(surface:CountVertices()))
for triangle = 0 , (TerrainSize*TerrainSize)+(TerrainSize-2) do --(surface:CountVertices())/2 do
point1 =trianglestrip
point2 =trianglestrip+(TerrainSize+1)
point3 =trianglestrip+(TerrainSize)-(TerrainSize-1)
point4 = point3+(TerrainSize+1)
--System:Print("Bottom:"..tostring(point1+1).."|"..tostring(point2+1).."|"..tostring(point3+1).."["..tostring(point4+1).."]")
--System:Print("Top:"..tostring(point2+1).."|"..tostring(point3+1).."|"..tostring(point4+1))
surface:AddTriangle(point1,point3,point2)
surface:AddTriangle(point2,point3,point4)
trianglestrip =point3
end
surface:Update(true)
System:Print("")
return terrain
end
This isn't quite ready for prime time. I need to swap the direction of the triangles every other row as described here: http://dan.lecocq.us/wordpress/2009/12/25/triangle-strip-for-grids-a-construction/ and that should be easy enough.
A last question, Is it possible to change the material for a single polygon as if it were a multi-material mesh?
-
I'm trying to make a terrain generator, I have the mesh plane generated, but I'm at a total loss at how to generate the uv's for all the triangles.
This is the code that I currently have. How would I go about programmaticly adding uv's?
function Script:MakeTerrain(TerrainSize)
local terrain = nil
terrain = Model:Create()
terrain:SetColor(0.5,0.5,0.5)
local surface = terrain:AddSurface()
-- add vertexes
System:Print("Generating Vertices")
for TerrainWidth=0 , TerrainSize do
for TerrainDepth=0 , TerrainSize do
surface:AddVertex(TerrainWidth*self.TerrainSquareSize,0,TerrainDepth*self.TerrainSquareSize, 0,1,0)
end
end
-- add triangles
System:Print("Generating faces")
trianglestrip = 0
System:Print(tostring(surface:CountVertices()))
for triangle = 0 , (TerrainSize*TerrainSize)+(TerrainSize-2) do --(surface:CountVertices())/2 do
point1 =trianglestrip
point2 =trianglestrip+(TerrainSize+1)
point3 =trianglestrip+(TerrainSize)-(TerrainSize-1)
point4 = point3+(TerrainSize+1)
System:Print("Bottom:"..tostring(point1+1).."|"..tostring(point2+1).."|"..tostring(point3+1).."["..tostring(point4+1).."]")
System:Print("Top:"..tostring(point2+1).."|"..tostring(point3+1).."|"..tostring(point4+1))
surface:AddTriangle(point1,point3,point2)
surface:AddTriangle(point2,point3,point4)
trianglestrip =point3
end
-- This is where you would add the uv's
System:Print("Adding UV's")
surface:Update(true)
System:Print("")
return terrain
end
-
Are you using a grayscale image as normal? If so leadwerks doesn't support that.Either generate a normal from the diffuse, or try to use the displacement/tesselation for the grayscale image.
- 1
-
This is using today's update. In the editor for example, the scripts folder you can see all the scripts and shaders of all the child folders instead of just the files in the current folder. I'm at work so I can't take screenshots.
-
Oh, thanks.
-
What version of catalyst are you using? I have uninstalled the drivers from AMD and I'm currently using the Windows update version but I'm still having issues.
-
I have not been able to test it with an nvidia card yet. I don't have my Linux box setup to run leadwerks and I have to install msvc++ runtimes on my tablets so I can test it on intel/powervr gfx.
-
Awesome modeling. You succeed where I fail and thats UV mapping. Good job!
-
I'm going to guess it's connected to this http://www.leadwerks.com/werkspace/topic/10988-editor-no-longer-allows-the-copying-of-prefab-copies/
-
If you look at this trigger setup it has an OnEnter which is only fired once so you can use that to have any size and avoid having the collision keep getting called.
I have ran across that, but in my case I needed it to fire for every entity that enters it. Using the wikidot script, I can push an entity into it and then I have a free pass to go through without dying. It gets worse if they make it so it just hurts people and not kill them. For example I wade into acid and then people chase after me. I would get all the damage and no one else would.
I do have a collision trigger script that is capable of tracking multiple entities entrances, exits and if they are just idling in the trigger. It is complicated due to me coding it to be network multiplayer friendly.
- 1
-
While making my game I ran into a situation where I needed to kill the player reliably and not depend on fall damage. The solution was to create a trigger that when the player touches it, they die.
Kill_trigger.lua
function Script:Collision(entity, position, normal, speed)
if entity.script then
if entity.script.health>0 then
if type(entity.script.Hurt)=="function" then
entity.script:Hurt(entity.script.health+1,"WORLD")
end
end
end
end
WARNING:
If the player is to FALL ON TOP of the trigger, the kill trigger MUST be almost paper Thin. Otherwise your dead body will keep bouncing as if were on a trampoline.
I used it for when the player falls in the water. When they fall in the river they die/drown.
- 3
-
In the latest beta you can no longer make a copy of a prefab, and copy the copy of the prefab. Also if you you make multiple copies of the first prefab instance and put them in a group, then try to copy the group it only copies the first instance.
-
Hmmm, thats odd.I'll see if i can try it from another computer. Here is a video of whats happening.
I have 2 AMD Radeon R9 270X 1GB in crossfire mode. on Windows 7 64
-
When using the glass material, I assume Leadwerks continues to cull the objects behind the object. This leads to views where most of your level is simply missing. This does not happen in the editor.
I have a map uploaded to demonstrate the bug. When you load the map in the editor you will see there are 3 colored boxes at the end of a path. When you start the map BEFORE you start to move, you will only see the blue box. Walk backwards and all the boxes appear. Walk back up to the glass. Strafe left or right. As you get to the edge of the glass the box in that direction appears. You can also make it happen by standing close to the glass and looking left or right.
Also is there way in lua to simply disable culling totally in the game? I have other issues with the way Leadwerks culls objects. If not, can I designate an object as something that should not be put in the culling list?
Select Surface
in Suggestion Box
Posted
Leadwerks does not seem to load the repeated textures in fbx files. Since your uv is simple I remade it.
BuroGeb1.zip