I would like to have a sphere with a world map texture and if the cursor is hovering a state this should be highlighted by drawing the state border with a bright color. Since the sphere is not flat i could not solved this with layered canvas widgets, do you know a way to solved this, having the states different shapes ?
Have you tried making highlighting in material?
I would do like this:
- create texture that only has state border (if you don’t have already in your textures)
- in material create parameter that will range from 0.0 to 1.0
- create Add node (you can play here, if you want with Lerp etc.)
- first plug should be connected to base color of state (that is plugged directly to main node Base Color)
- second plug should be channel of that border from texture
You should have now brighter border.
Note: if you use Add node, keep in mind that if border is already white, you won’t see change (because each color channel is in range 0.0 - 1.0). In this case, you could try using different color for border and then divide output from Add node by 2.
One benefit doing this in material is also that this can be animated from blueprint
Sounds good, did not think about using materials, but how i could do this approach for many states which only habe their border display on mouse over ?
Does your solution just flipflop all borders at once?
You could handle multiple states with multiple parameters. If you need additional state, then call it “HoverHighlight” (which also accepts values 0.0 - 1.0) and then make Lerp with 1st input 0.0 and 2nd input connected with channel that contains border from texture (alpha is HoverHighlight parameter). Then output from Lerp you can connect to Opacity to hide border.
Does your solution just flipflop all borders at once?
It really depends how you are handling borders. If you have single texture containing all borders, then yes. Solution to this would be to use offsets or maybe to create smaller textures that contain borders for each state (so you can have more control over what gets highlighted).
i see, may be an missunderstoodment, i really mean a state as in united states… so having a world map of this planet, i dont know how to apply for eacht state/country the specific material to be highlighted
Oh, I think I get it now, you have one sphere which contains many states.
Ok, that is tricky. The easiest way that crosses my mind would be to:
- create texture showing only one state border (rest is transparent) - do that for each state, then it should be easy to Lerp with WorldTexture
- create transparent actors above states that will catch mouse event (each actor will set appropriate state highlighting to sphere material)
This is not best solution (code redudancy, too many textures - but they could be merged) but I am not sure what else could be done in this regard.
Maybe you could create separate mesh for each state so when they put together they look like sphere?
On that way, not only that you could highlight borders of state, you could make it popup a little (just an idea).