Jump to content

Decals


Gandi
 Share

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

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

Link to comment
Share on other sites

  • 2 weeks later...

"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]?

desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP

laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32

Link to comment
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!

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

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?

desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP

laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32

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

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

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

Link to comment
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)

desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP

laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32

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

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

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?

desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP

laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32

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