Jump to content
Gandi

Decals

Recommended Posts

I spent the last day on creating a terrain-decal script for the LE Editor.

 

 

the benefits of my system are:

the density of vertices is depending on the scale of the terrain.

So if the terrain has scale of 2meters my decal also got a scale of 2 meters.

the vertices are updated on the cpu, but only if they are being manipulated. so after placing the decal no more computations are needed for it.

 

FPS decrease when manipulating a big decal, but if you dont move/scale/rotate it theres no change of frames.

 

Some Questions:

How can i archieve, that when clicking on the decal it selects the decal, just like the road?

 

€:

Posted my code in the download section

 

Please report any bugs to me.

have fun

Share this post


Link to post
Share on other sites

.....what he said! :P

 

 

are you able to allow the decal to traverse(project) over multiple objects and the terrain at the same time?

Share this post


Link to post
Share on other sites

.....what he said! :P

 

 

are you able to allow the decal to traverse(project) over multiple objects and the terrain at the same time?

This system is only meht to be used for terrain and the terrain also shouldnt be changed at runtime.

you can apply it to objects because:

the density of the mesh fits exactly to the terrain, so wont cover objects right

the mesh takes the height values from the terrain for setting the vertex-positions.

 

I will share the code when i get the selection to work.

Share this post


Link to post
Share on other sites

Please add me to your list of people who can't wait for you to share this code :)

Share this post


Link to post
Share on other sites

I know I already mentioned this two weeks ago, but...

 

will you be sharing this with the community?

+ 1

Share this post


Link to post
Share on other sites
Some Questions:

How can i archieve, that when clicking on the decal it selects the decal, just like the road?

 

I will share the code when i get the selection to work.

 

 

 

This man need some help before :)

Share this post


Link to post
Share on other sites

"Some Questions:

How can i archieve, that when clicking on the decal it selects the decal, just like the road? "

 

That is indeed strange, it looks like you can select it from the righthand-menu, right?

What happens when you make the decal "stick out" a little bit more from the terrain, like: TerrainHeight + [value]?

Share this post


Link to post
Share on other sites

I think its going to depend on how he created the decal on whether clicking on it will make it selectable. Another method shown in the forum, used a premade plane model and that would have made the decal selectable. I assume gandi is making his decal via lua code inside an object script, so I don't think it will react when selected. Perhaps if 2.32 still had the ability to group entities together it would work? In any case gandi, this looks great. nice work as always!

Share this post


Link to post
Share on other sites

I think its going to depend on how he created the decal on whether clicking on it will make it selectable. Another method shown in the forum, used a premade plane model and that would have made the decal selectable. I assume gandi is making his decal via lua code inside an object script, so I don't think it will react when selected.

 

That's what I thought too at first (at least that's the way I would tackle this problem), but then, how is he scaling and rotating the mesh(es) in the video?

Share this post


Link to post
Share on other sites

That's what I thought too at first (at least that's the way I would tackle this problem), but then, how is he scaling and rotating the mesh(es) in the video?

 

assuming he is creating the decal plane in code, I guess he is just taking the rotation and scale of the dummy mesh that he is selecting and copying those values to the decal plane...

Share this post


Link to post
Share on other sites

yes you are right macklebee and the reason i dont just create the surface on the same mesh as the model is is, that i dont move the vertices everytime i move the mesh, and im calculating the rotation/scale on my update code instead of really rotating the mesh..

Share this post


Link to post
Share on other sites

"assuming he is creating the decal plane in code, I guess he is just taking the rotation and scale of the dummy mesh that he is selecting and copying those values to the decal plane... "

 

"yes you are right macklebee"

 

Doesn't that mean that you CAN select the dummy mesh? If so, can't you make the dummy mesh a bit bigger to make it selectable?

I think the group command is for hiding/showing groups of meshes but not to actually group them together as one mesh (not sure though)

Share this post


Link to post
Share on other sites

"assuming he is creating the decal plane in code, I guess he is just taking the rotation and scale of the dummy mesh that he is selecting and copying those values to the decal plane... "

 

"yes you are right macklebee"

 

Doesn't that mean that you CAN select the dummy mesh? If so, can't you make the dummy mesh a bit bigger to make it selectable?

I think the group command is for hiding/showing groups of meshes but not to actually group them together as one mesh (not sure though)

 

The dummy mesh that I am referring to is the invisible mesh like what the lights and emitters use. Its just a small sphere so you have something to select in the editor with the mouse. He is taking the rotation and scale of this mesh and applying them to the decal plane that he created in code.

Share this post


Link to post
Share on other sites

Yes, I understand, but it doesn't matter what the dummy mesh is, so why not make the dummy mesh an invisible box (for instance) and make that box as large as your decal, making sure that some part of the box is always sticking out of the terrain to make it selectable?

Share this post


Link to post
Share on other sites

Yes, for a large decal, especially on very slopey (is this a word?) terrain this would not be ideal for picks...

Share this post


Link to post
Share on other sites

i personally think it would useable as it is right now since you could always just select it from the asset list on the rightside of the editor if you needed to move/rotate/scale it...

Share this post


Link to post
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.

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