-
Posts
2,335 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Everything posted by SpiderPig
-
I've noticed similar things with other models where a previously loaded texture applied to a totally different model will overlay onto it. Might be a bug... no sure.
-
I'd download in FBX. Just drop it into your models folder and it should convert to .mdl automatically. EDIT : You may have to setup a material for it though. The textures will convert when you place them in the folder too.
-
I have a problem with the geometry shader I'm working on. If someone could tell me why it works until I un-comment the line, RunLOD(4); That'd be great. The shader, material and a grid model is attached. Thanks. EDIT : Commenting out EmitVertex() solves the linking issue - but why? EDIT : If I'd only looked at the Error log I had hidden to the edge of the screen I would have see this; 2: Line 0: Hardware limitation reached, can only emit 60 vertices of this size Well that solves that.
-
I second this. I'm always moving it out the way.
-
Lua Break-points not removing
SpiderPig replied to SpiderPig's topic in Leadwerks Engine Bug Reports
I agree. It would be nice if you could mouse over variables like C++ and see they're value. As for the above error, I think I've narrowed it down to removing a break-point while the program is running. The icon is removed but the program keeps breaking there. -
Spent ages trying to figure out why a certain line of code keep breaking the program. After deciding to restart Leadwerks I reopened the script file and suddenly there was a break-point at that line. I did remove it before hand, but it obviously just removed the icon, not the actual break-point. Hope this can be resolved soon.
-
Commenting out, self:MakeNums(self.CurrentCode) in the update world loop stops the crash on the second time. But for the life of me I can't debug it with breakpoints. It's as if, with the function, it crashes second time around for a different reason? But without calling the function, it works... I'm going to need a coffee
-
Thanks for the help. I think I'll have to do it that way. Buffer Objects aren't big enough for my needs.
-
Does anyone know how to set a Uniform Buffer Object from c++? The Geometry shader has the following Buffer Object; layout(std140) uniform DataBlock { float terrainHeight[1024]; }; https://www.khronos.org/opengl/wiki/Uniform_Buffer_Object Not sure how to get the program ID from a shader in Leadwerks. Or will I have to use OpenGL commands directly?I I figured out how to at least get the Data Blocks index; Shader* sh = material->GetShader(); OpenGLShader* gl_sh = (OpenGLShader*)sh; unsigned int block_index = glGetUniformBlockIndex(gl_sh->program, "DataBlock"); if (block_index != GL_INVALID_INDEX) { //bind it here } This command gets the size (in bytes) that is available for each buffer; int size; glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &size); In this case it was 65,536 bytes. I think there is a max number of buffers allowed too.
-
I figured out how to do it now, thanks. It seems that gl_Position doesn't let the shader link when inside a loop that uses a uniform variable as a end condition. int current_level = 0; uniform int lod_level = 1; while(current_level < lod_level) { current_level++; gl_Position = pos; EmitVertex(); } This isn't all the code, but commenting out gl_positon or changing the while loop to; while(current_level < 2) will then work.
-
Thanks. I'll take a look.
-
Thanks. I just tried a few things and found I was wrong with the reversed axis's. I'm a little confused still on how to create a vertex in between two original vertices...
-
I'm currently trying to subdivide a triangle in the geometry shader. I put the material using the shader on a plane made from two triangles. However it seems that the coordinates in GLSL are different to that in Leadwerks? That the positive X axis in Leadwerks is actually the negative X axis in the shader. And the same for the Z axis. The Y axis seems fine. I want the shader to turn the plane of two triangles into a more detailed grid for a terrain. I know the shader works on each triangle, so I will have to divide each triangle itself into the appropriate triangles so that the end result in game looks like a uniform grid. I've thought of tessellation but I don't think it'll give me the results I'm looking for. Any help with this is appreciated. Thanks.
-
Hi Josh, I would like to see more flexible commands surround the surface class. This will make real-time modification of large dynamic meshes much easier and hopefully faster, allowing for more control of what type of games that can be made. AddVertices(vec3** positions) RemoveSurface(int index) RemoveSurfaces(int* indexes) RemoveVertex(int index) RemoveVertices(int* indexes) RemoveTriangle(int index) RemoveTriangles(int* indexes) SetTriangleIndice(int index, in a, int b, int c) Creating a grid of only 256 x 256 vertices seems to take a lot longer than if programming it in a bare C++ OpenGL application using VBO's. Is there a reason for this? Thanks.
-
Thanks, that did the trick. For those who are interested here's the code I used. float cx = Math::Round(context->GetWidth() / 2); float cy = Math::Round(context->GetHeight() / 2); Vec3 mpos = window->GetMousePosition(); window->SetMousePosition(cx, cy); mpos = mpos * looksmoothing + mousepos * (1 - looksmoothing); float dx = (mpos.x - cx) * lookspeed; float dy = (mpos.y - cy) * lookspeed; Vec3 prot = player->GetRotation(); prot.y = dx; player->SetRotation(prot); Quat phy_rot = player->GetQuaternion(true); player_pivot->PhysicsSetRotation(phy_rot, 1.0); The physics shape is assigned to the pivot, and the model of the player is parented to the pivot.
-
Thanks Josh, an extra argument would be great. I tried the code but moving the mouse left and right just added to the players rotation so I changed the code from; prot.y += dx; to prot.y = dx; which did help. It gave me a rotation about the Y axis which followed the mouse. But when the player rotates 90 on the X axis and then I use this code in the update loop it goes haywire. Rotating in all manor of directions without stopping. My player is setup like this. Model* model = Model::Cylinder(); model->SetShape(Shape::Cylinder()); model->SetCollisionType(COLLISION::PLAYER); model->SetMass(10.0, 0, -1, 0, 1, 1, 1);//to make it more stable standing up model->SetPosition(Vec3(0, 5, 0)); model->SetRotation(90, 0, 0);//this makes it go hay wire Basically I'm making my own character controller because the player is pulled toward different gravity directions through out the game. So I always want the player to rotate left and right with the mouse no matter what direction is down.
-
I second this. You would think fog would be one of the first shaders included.
-
Yeah you're probably right. I just wanted to use a shape that wasn't a primitive.
-
Seeing through the walls might be the material settings. Make sure depth test and depth mask are checked. Not sure about why it's on multiple walls though...
-
I'm unsure how exactly to use Transform::Rotation in order to rotate my physics object about it's local Y axis. The code below works when the player is upright, but if it rotates 90 degrees on the X axis (lying down basically) it rotates about the global Y. How can I use this to transform to local? float cx = Math::Round(context->GetWidth() / 2); float cy = Math::Round(context->GetHeight() / 2); Vec3 mpos = window->GetMousePosition(); window->SetMousePosition(cx, cy); mpos = mpos * looksmoothing + mousepos * (1 - looksmoothing); float dx = (mpos.x - cx) * lookspeed; float dy = (mpos.y - cy) * lookspeed; Vec3 prot = player->GetModel()->GetRotation(true); prot.y += dx; Vec3 v = Transform::Rotation(prot, NULL, player->GetModel()); player->GetModel()->PhysicsSetRotation(v, 1.0); Thanks.
-
Is a PolyMesh() trigger suposed to work? I set one up but every time objects fly straight through without invoking the collision hook. Using a sphere or box though works fine.
-
This is also exactly what I'm after. Thanks!
-
Great job! Simple yet fun to play. Love the music to.
-
Not a problem. Glad its working now.