scrypt Posted June 23, 2010 Share Posted June 23, 2010 Hello, I am thinking of using LeadWerks (at work, too...) to enable more advanced graphing capabilities, and varius graphics tasks; For instance, instead of using heightmap data for hills (say...) use the same technique (heights related to specific values and shown in spectrum colors) but go from red to violet showing RPM, instead of trees and vegitation. Circular hills whose heights represent certain input values. Changing values for such a mesh I see would be no problem and is pretty much straight forward (doing the mesh tut as I type this) using LeadWerks. But assigning colors to the vertex's though, is less so, and seems to require shaders? I am in the first chapter of a book on a-the, programmable graphics pipeline. That, too (assigning vertex colors to a procedural mesh based on heightfield data), is trivial in OpenGL but I am wondering how (best) to go about it, get at them, using LeadWerks...? And of course the above means that this is a procedural-dynamic implementation. Any sugeestions are welcome. Thanx Scrypt Quote Link to comment Share on other sites More sharing options...
macklebee Posted June 23, 2010 Share Posted June 23, 2010 changing vertex colors is easy in LE, but i guess the problem you may have is determining which specific vertex gets what color. How are you planning on determining this? Are you picking the vertices by a raycast or what? Or am I just misunderstanding what you are doing? Or are you trying to create a colored heightmap? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Canardia Posted June 23, 2010 Share Posted June 23, 2010 It's easy to get the exact mesh, face and 3D point which was picked with the mouse when you use EntityPick(). Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
macklebee Posted June 23, 2010 Share Posted June 23, 2010 yes, thats why I asked how he was planning on choosing the vertices. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
scrypt Posted June 23, 2010 Author Share Posted June 23, 2010 Thanks for the quick reply Macklebee. To visualize it for one value; There is a cirular mesh ten units in diameter, with a with a one unit wide (concentric) circle five units in diameter. With a value scaled to go from zero to 255... As the input value changes I would either raise or lower the vertex's contained within the "circle" accordingly; I.E I would know before hand which verts I wanted to modify. How and or the best most efficient way to go about it in LeadWerks, is what I am trying to discern. Thanks again. Quote Link to comment Share on other sites More sharing options...
Canardia Posted June 23, 2010 Share Posted June 23, 2010 The easiest way is just to modify the vertex positions of the mesh on the fly using the SetVertexPosition() command: http://www.leadwerks.com/wiki/index.php?title=Surfaces#SetVertexPosition I doubt it's needed to do it with a shader, but of course that might take less CPU and GPU power. Of course you could also just scale the mesh on the fly if you want to "raise" all vertices at the same time, but I think you want some custom deformation. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
macklebee Posted June 23, 2010 Share Posted June 23, 2010 ok, just to clarify: the mesh is already colored and you are trying to set the height based on color or you are trying to assign a color to a vertex based on the height of the vertex? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
scrypt Posted June 23, 2010 Author Share Posted June 23, 2010 Lumooja thanks for the information. Macklebee, the mesh is at "ground state" i.e. no height and no colours till the program gets input. Says there's an engine (actually there is) and I am broadcasting data via comsat to, where ever... (which I am) when engine rpm data comes in (which it does, but it's all text... doing this in LeadWerks would be way cooler), I want the mesh to reflect this change by a rise in height and a change in color. Moving the verts around I am finding easy (the more so thanks to yourself and Lumooja) but assigning them colours based on new input is the issue. Thanks again, Scrypt Quote Link to comment Share on other sites More sharing options...
Canardia Posted June 23, 2010 Share Posted June 23, 2010 SetVertexColor() should be just as easy Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
scrypt Posted June 23, 2010 Author Share Posted June 23, 2010 Lmao thanks Macklebee, Lumooja. I should be able to take it from here. As an aside I did and do, want my (non-work related) game to created using some form of procedural algo's, this will help a lot. Thanks again. Quote Link to comment Share on other sites More sharing options...
Canardia Posted June 24, 2010 Share Posted June 24, 2010 Yeah, the cool thing is that LE allows both procedural and OOP coding, and you can even use both at the same time. I do also code in first place procedural, since it needs less thinking. I just want to code first, and then later on make it nice and shiny by converting to OOP syntax, if I have time and will. Otherwise, it just remains procedural and nobody will ever know the difference Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
paramecij Posted June 25, 2010 Share Posted June 25, 2010 Yeah, the cool thing is that LE allows both procedural and OOP coding, and you can even use both at the same time. I do also code in first place procedural, since it needs less thinking. I just want to code first, and then later on make it nice and shiny by converting to OOP syntax, if I have time and will. Otherwise, it just remains procedural and nobody will ever know the difference This is pretty much how I go about things also .. In CG - If it looks right, it is right Quote Link to comment Share on other sites More sharing options...
scrypt Posted July 8, 2010 Author Share Posted July 8, 2010 Though all the tut's were done for all intents and purposes procedually there was still an eye as to the "thousand foot" framework (OOP), so when I was speaking in terms of procedural I was speaking of procedural as in "Perlin Noise" ... (for instance) procedural For a number of reasons; 1) In terms of bandwidth, a 1k algo can generate a texture that would represent 8mb's, easy... 2) Fully dynamic world. Ok two, for me, and for now ... real big ones. Again, thanks for the help guys. Scrypt B) Quote 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.