Jump to content
blueapples

Pushing terrain vegetation into ground

Recommended Posts

I am having a hard time finding a way to tweak the way that vegetation objects appear, specifically I am hoping to push them into the ground a bit to improve their appearance a bit. Right now roots are very visible on trees and rocks rest unnaturally on top of the terrain rather than appear partly into the terrain surface. Is there a way to do this that I'm missing? Ideally I'd like a method that can work on mld files. I know with fbx source files I can edit the models and this would probably solve my problem but I'm trying not to change my source models too much unless I'm rebuilding them.

Any help is appreciated.

Share this post


Link to post
On 9/25/2017 at 4:19 AM, blueapples said:

I am having a hard time finding a way to tweak the way that vegetation objects appear, specifically I am hoping to push them into the ground a bit to improve their appearance a bit. Right now roots are very visible on trees and rocks rest unnaturally on top of the terrain rather than appear partly into the terrain surface. Is there a way to do this that I'm missing? Ideally I'd like a method that can work on mld files. I know with fbx source files I can edit the models and this would probably solve my problem but I'm trying not to change my source models too much unless I'm rebuilding them.

Any help is appreciated.

Reset the model file itself so that the polygons are lower.

Share this post


Link to post

Yeah I am aware of that as an option for custom assets prior to import, but as far as I can tell there isn't a way to do that for files that have already been imported or come from with the engine or an add-on pack, correct? It would be really nice if this were an option that could be tweaked in the vegetation settings for each item and a setting to have it randomly vary by some amount, it would really add a lot of visual variety without requiring more assets to be imported for each variation of depth a rock is pushed into the ground, for instance.

  • Like 2

Share this post


Link to post

I'm thinking L5 will allow a Lua script to run like a plugin, so you will be able to do stuff like this:

function RepositionVertices(model, offset)
	for n=0 to model:CountSurfaces()-1
  		local surf = model:GetSurface(n)
  		for v=0 to surf:CountVertices()-1
  			local pos = surf:GetVertexPosition(v)
  			pos = Transform:Point(pos,model,nil)
  			pos = pos + offset
  			pos = Transform:Point(model,pos,nil)
  			surf:SetVertexPosition(v,pos)
  		end
  	end
	for n=0 to model:CountChildren()-1
		RepositionVertices(model:GetChild(n),offset)
  	end	
end

if Editor.ModelEditor.model~=nil then
	RepositionVertices(Editor.ModelEditor.model, Vec3(0,-1,0))
	Editor.ModelEditor:ChangeFile()
	Editor.ModelEditor:Render()
end

 

  • Thanks 1

Share this post


Link to post

That would be epic. I was wondering if there's a possibility for the same thing in C++ maybe? Like, load the project's custom code as a DLL into the editor and allow for extensions that could add really basic interface elements such as a custom sidebar panel, then create / manipulate world objects. I want to stick with Leadwerks and if I can develop my own systems by creating editor extensions in C++ that would go a long way towards making it an even more long lasting platform. Same thing is Lua would be a really great start though.

Share this post


Link to post
15 hours ago, blueapples said:

That would be epic. I was wondering if there's a possibility for the same thing in C++ maybe? Like, load the project's custom code as a DLL into the editor and allow for extensions that could add really basic interface elements such as a custom sidebar panel, then create / manipulate world objects. I want to stick with Leadwerks and if I can develop my own systems by creating editor extensions in C++ that would go a long way towards making it an even more long lasting platform. Same thing is Lua would be a really great start though.

Hmmm, C++ plugins via a DLL might be possible.  It would also be possible to call a DLL from a Lua script.

I'm really looking forward to developing the Leadwerks 5 editor.  It's going to be my masterpiece, with the community's help. :cool:

  • Like 1

Share this post


Link to post

Main reason I'd be interested in C++ is for performance to do stuff like a new object streaming system I have in mind that would create and remove objects dynamically (picking up edits to objects and saving them out to a database before unloading them). Not sure if Lua as glue would cause too much of a delay, it might work, but would be ideal for it to be a native interface.

Either way sounds very exciting, can't wait to get my hands on v5.

Share this post


Link to post

Sorry for hijacking this thread but if Josh says something like "new editor", I think I want to add something. Its just a recommendation. The good ol´hammer editor had this baby here.

https://developer.valvesoftware.com/wiki/Hammer_Vertex_Tool

At the moment, the shapes and operators are not enough to make any shape. for example roofs.

The other benefit is, back in my days we had FPS problems as well, so to maintain a good performance we used triangles in combination with this tool. for example rockformations, uneven grounds etc. what kept perfomance high and allowed much more varieties.

To come to an end, I just want to say, this tool is very useful and should be added.

Share this post


Link to post

And to the thread itself, any model has this root point. so you need to set this point higher. That is where the model is placed as far as I understand it.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...