-
Posts
3,946 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by macklebee
-
-
4 minutes ago, CangoJoe said:
Ok cool thanks,
I'm just trying to wrap my head around the purpose of DrawRect() in your sample.
All I am doing is drawing a rectangle the same size as the window/context and fading to black/white by just adjusting the alpha component in the rectangle's color settings.
-
hmmm... are you sure its the model? maybe something with the material you have? This model and texture supplied does not cause the standard 4.4 version to crash for me.
-
16 minutes ago, Yue said:
Ok, here Download Sample.
https://www.dropbox.com/sh/qpaxiitgxkobsll/AAAEw_jyKTFh7roJ0M0zfthDa?dl=0What are you using to compress? Unable to unzip or the file is corrupt.
- 1
-
That link is just the contect:DrawRect() from the old command index. If you look 5 posts up, I have code that shows how to fade from black to white and back to black - just modify it for your needs:
- 1
-
26 minutes ago, Josh said:
Can you post your model with an example? I don't know why it is so front-heavy.
You can download the model for free from here: https://free3d.com/3d-model/forklift-21058.html
-
2 hours ago, Josh said:
Ah, so this would place dead leaves around the tree automatically.
How about instead of this specific feature request, implement the ability to use prefabs for vegetation which would cover this as well as other similar requests?
-
I personally haven't really tried vehicles since LE2, but I assume that vehicle:SetSteering(angle) will do it. Have you tried the example shown for vehicles in the leadwerks documentation to see if it works?
- 1
-
Just in case you do not realize, but there is a search function built into the forum. I think you will find it helps answer a lot of questions. The following are from just typing 'vehicle' into the search... note that vehicles have been in the process of being reworked for quite awhile now and may not be stable.
- 1
-
Without an example map to try all we can do is guess. Help us to help you...
But these are my guesses:
1) Are you by chance using posteffect shaders in your game, like bloom, that would cause any blurring?
2) I wonder if the texture quality in game is being set by default to a lower resolution than what is by default being used in the editor? Refer to this post for information:
3) Also, if that does not resolve it, take a look at some of the other settings:
- 1
-
I am not sure I understand what you are asking, but are you trying to do Entity:Point()?
-
-
10 hours ago, Josh said:
There will be code changes in Leadwerks 5, and the materials system will be different, but yes.
What are you doing different with the material system?
-
Export model to fbx to project folder and leadwerks will automagically convert to MDL format. Create material from diffuse, normal, specular, etc textures and shaders to apply to MDL model.
- 1
-
well look what the cat dragged in! long time no see, stranger! hope all is well,
-
-
10 hours ago, martyj said:
The entity that cannot be found is a Box.
The entity that can b e found is a Pivot
I've updated my sample to reflect the topic.
I wrote my own FindEntity function to try to see if there is a bug in the World's FindEntity. It just loops through the world entities calling World::GetEntity(n) and compares the name.
Both my version and the LE version have the same problem, I'd imagine they are along the same lines of code.good to know - without that info about your own function it makes people guess at the problem.
when you say the entity that cannot be found is a Box are you referring to a CSG created box or an actual model that has been imported? Because like Aggror has asked/implied about twice now: if that entity is a CSG created box that you made in the LE world editor and you do not have the mass set greater than 0 or a lua script attached, then that CSG brush will be collapsed into one object with all the other mass-less, script-less CSG objects in the world which would prevent you from finding it via the "name" key.
If for some reason this is an imported model or you have set mass or script to a CSG created box, then I would suggest posting an example map and sample code so others can try to replicate the issue.
-
App:FindEntity("EndAsdfgwg")
why are you doing App:FindEntity()? shouldn't it be 'world:FindEntity()' since you went to the trouble of finding the current world and thats the title of your topic? And are you for some reason still using the very depreciated app.lua scripting?
-
I remember a similar issue that baffled many a person years ago with a inherent LE2 underground tunnels prop that prevented the player from moving over a very small bump on the floor. The height of it should have not caused the player any issues moving over it. What it turned out to be was that if you zoomed way in to see the profile of this small bump, its face angled in such a way that the player controller was interpreting the face as a slope too great for the controller to climb.I think the fix was to clean up the angle and it seemed to work properly after that.
Edit - if memory serves there was another issue with one of the underground tunnels props as well where a particular corner of the tunnel prop had alot of geometry all happening in a very small - almost pin size- area. So when a controller would walk over it, it would randomly sligshot the controller all over the room. Anywho - my suggestion is to check the model especially if you are building your physics shape off of it. I would suggest keeping the physic shapes as simple as you can.
-
A free polygon reducer is called meshmixer - typically used for prepping models for 3d printing - but i have found it works great for reducing the polygon count while maintaining control over the quality of the shape.
-
You did not make a Leadwerks material like mentioned and linked to above.
To make a material, right click on the imported texture and select 'Generate Material'. Double-click the new material and add your textures and shaders to the material and save. Once you have the material created and you have imported the model into LE, double-click the model and it will open the Leadwerks Model Editor. You can attach your material to the model under the listed surface in the mesh hierarchy tab.
See the tutorials about models and materials:
https://www.leadwerks.com/learn?page=Tutorials_Editor_Materials
https://www.leadwerks.com/learn?page=Tutorials_Editor_Models-and-Animation
Suggest you read all of the official tutorials as there is a lot of useful information available.
- 1
-
Post the model with textures and the LE material you made for it or all we can do is randomly guess what the solution to your problem may be.
Edit - my random guess is that either the model is being saved without an UV map or you havent created your LE material properly.
https://www.leadwerks.com/learn?page=Tutorials_Editor_Materials
-
Well, you can do an alpha mask by simply making the holes in the texture full alpha and using an inherent alpha-related shader. Look at how the textures for leaves are done to see an example or the section regarding custom shaders in the Materials tutorial: https://www.leadwerks.com/learn?page=Tutorials_Editor_Materials
-
12 hours ago, Josh said:
Custom post-process effects are attached to a camera. I do not understand how a geometry shader relates to this.
Thats because my custom geometry shaders use Draw()-related commands. So you are saying something as simple as text now will require a sprite? Sounds very counter-intuitive. How will custom buffers be supported? Or are they going to be officially supported finally in LE5?
- 1
-
15 hours ago, Josh said:
Note there is no call the context::Sync because once you start the world render, it goes off on a separate thread and goes out all the way to the monitor. There are no drawing commands you can call after that. I think we're going to have a system of persistent 2D sprites you create, rather than drawing commands you call.
The Render command itself only passes any changed positions to the culling thread and returns to your program, so there is really nothing to slow your game code down and if the timing isn't limited it will execute at like 1000 updates per second.
er - what? you need then to give access to the render thread so we can use drawing commands. All custom post-process and geometry shaders would be affected by this, would they not? A 2D sprite doesnt isnt quite the same. So you are saying GUI's now will all be sprites?
- 2
Middle Mouse Button Use
in Programming
Posted
Just like you would for any other time for the camera rotation but make the middle mouse button the qualifier for allowing the camera to rotate. Look at the orbital camera example I posted almost two years ago for an example:
Here's the same code updated to show the use with middle mouse button instead of the right mouse button:
window = Window:Create("Orbital Camera",0,0,800,600,Window.Titlebar+Window.Center) context = Context:Create(window) world = World:Create() camera = Camera:Create() camera:SetSkybox("Materials/Sky/skybox_texture.tex") light = DirectionalLight:Create() light:SetRotation(35,35,0) player = Model:Load("Models/Characters/generic/generic.mdl") player:SetColor(0,1,0,1) pivot = Pivot:Create() pivot:SetPosition(0,0.8,0) camera:SetParent(pivot) camera:Move(0,1,-3) mx = 0 my = 0 prevmx = 0 prevmy = 0 toggle = 0 while window:KeyDown(Key.Escape)==false do if window:Closed() then break end if window:MouseHit(Key.MButton) then toggle = 1 end if window:MouseDown(Key.MButton) then mousepos = window:GetMousePosition() mx = pivot:GetRotation().x + (mousepos.y-prevmy) my = pivot:GetRotation().y + (mousepos.x-prevmx) if toggle==1 then toggle = 0 mx = pivot:GetRotation().x my = pivot:GetRotation().y end pivot:SetRotation(mx,my,pivot:GetRotation().z) prevmx = mousepos.x prevmy = mousepos.y end Time:Update() world:Update() world:Render() context:SetBlendMode(Blend.Alpha) context:DrawText(string.format("FPS: %.1f",Time:UPS()), 2, 2) context:DrawText("Hold Middle Mouse Button Down to Rotate", 2, 22) context:SetBlendMode(Blend.Solid) context:Sync(true) end