Scott Richmond Posted July 9, 2012 Share Posted July 9, 2012 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. Quote 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 More sharing options...
Pixel Perfect Posted July 9, 2012 Share Posted July 9, 2012 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! Quote 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 More sharing options...
Scott Richmond Posted July 9, 2012 Author Share Posted July 9, 2012 Are you saying that the grass in Leadwerks is hardcoded into the terrain entity type and is impossible to deploy anywhere else? Quote 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 More sharing options...
Pixel Perfect Posted July 9, 2012 Share Posted July 9, 2012 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. Quote 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 More sharing options...
Scott Richmond Posted July 9, 2012 Author Share Posted July 9, 2012 So, I haven't tried this at all but it does compile: Model m; m.Load("oildrum.gmf"); Terrain t(m); Any reason why this might not work? Quote 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 More sharing options...
Pixel Perfect Posted July 9, 2012 Share Posted July 9, 2012 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? Quote 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 More sharing options...
Scott Richmond Posted July 9, 2012 Author Share Posted July 9, 2012 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. Quote 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 More sharing options...
Pixel Perfect Posted July 9, 2012 Share Posted July 9, 2012 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. Quote 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 More sharing options...
Admin Posted July 9, 2012 Share Posted July 9, 2012 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. Quote Link to comment Share on other sites More sharing options...
Scott Richmond Posted July 9, 2012 Author Share Posted July 9, 2012 So, even if I was using terrain properly, I still cannot use vegetation at all without the editor? Quote 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 More sharing options...
Recommended Posts
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.