Jump to content

Implementing Leadwerks Vegetation via code?


Scott Richmond
 Share

Recommended Posts

I'm currently using models rather than a 'terrain' mesh to make up my various pieces of environment and I'm wondering if anyone can give me any advice on how Leadwerks implements its vegetation system, specifically the grass.

Do I need to add a shader to the mat file of the material I apply to the model? Do I need to maybe generate a 'grass mesh' on top of my models, sort of like a decal?

Any documentation or advice would be appreciated.

Programmer, Modeller

Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64

Visual Studio 2008 | Photoshop CS3 | Maya 2009

Website: http://srichnet.info

Link to comment
Share on other sites

For all things Leadwerks the best starting point is the Leadwerks User Guide however the vegetation system in Leadwerks is based upon the terrain system. So no terrain - no vegetation system!

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

I'm saying that all of the vegetation functionality is tied into the terrain system. After all it deploys vegetation over the terrain, either all of it, at the press of a button, or it allows you to paint vegetation layers on the terrain. Either way a Leadwerks terrain is required. You cannot deploy vegetation onto mesh models!

 

Nothing to stop you designing your own vegetation system of course and yes you might be able to use some aspects of the existing code/shaders but none of this functionality is exposed other than through the terrain interface in the editor.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

I'm not sure I understand what you think you are doing in that code.

 

You have loaded a model and created a function thats designed to convert a model into a terrain? If this is LEO I guess you just created an instance of a Terrain Class based on a pointer to a loaded model? Maybe you'd like to elaborate?

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

I'm not sure I understand what you think you are doing in that code.

 

You have loaded a model and created a function thats designed to convert a model into a terrain? If this is LEO I guess you just created an instance of a Terrain Class based on a pointer to a loaded model? Maybe you'd like to elaborate?

 

The constructor for Terrain is able to take an instance of Entity. So, I'm assuming here that if I pass it an instance of Model it'll allow me to apply and use some of the terrain features to the model. I think only Josh could tell us whether this sort of thing could work. Or I could just try it.

Any idea how I enable vegetation over a Terrain in C? I suppose I'll just try it and see what happens.

Programmer, Modeller

Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64

Visual Studio 2008 | Photoshop CS3 | Maya 2009

Website: http://srichnet.info

Link to comment
Share on other sites

Well, I assume that it's designed to take a pointer to a terrain entity. In Leadwerks all named entity types are fundementally just char pointers so it won't distinguish between a TTerrain pointer and a TModel pointer hence the fact it compiles; but the two are normally pointing to completely different objects.

 

As I previously indicated, outside ot the editor non of the vegetation functionality is exposed. You might check Klepto2's community version of the engine.DLL as I believe that has exposed many more functions but I don't know to what extent the vegetation functionality is exposed ... if at all.

 

Sure Josh could give a categorical answer to this but in the mean time I would assume you will need to implement your own system in totality if not using Leadwerks terrain.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

I'm saying that all of the vegetation functionality is tied into the terrain system. After all it deploys vegetation over the terrain, either all of it, at the press of a button, or it allows you to paint vegetation layers on the terrain. Either way a Leadwerks terrain is required. You cannot deploy vegetation onto mesh models!

This.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...