Jump to content

Best way to go about this


scrypt
 Share

Recommended Posts

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

Link to comment
Share on other sites

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?

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

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.

Link to comment
Share on other sites

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.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :)

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

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 :D

This is pretty much how I go about things also .. In CG - If it looks right, it is right :o

Link to comment
Share on other sites

  • 2 weeks later...

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 :blink: 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)

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...