Jump to content

A way to create road on ground


TomaszFurca
 Share

Recommended Posts

Hi, I try to create road on ground. With stencil method in bledner after export big ground it texture is converted to 1024 px, so texture of ground is in very poor quality, so i make it in BJS using:

myTexture.uScale = 10.0;
myTexture.vScale = 10.0;

Then i have looped texture on ground with fine quality. But this method i can't create road on ground.

Some screens from bledner:

8Y30bK.png

Dx4l7D.png

mZIPjg.png

Is any way to create road using this way, but in BJS? I want to put road texture on white color (preview texture).

 

Edited by TomaszFurca
Please move this topic to questions :)
Link to comment
Share on other sites

hmm, no replies yet, eh TF?  Darn.

@NasimiAsl built SOMETHING with shaders, once.  https://www.babylonjs-playground.com/#1IAR36#12

It doesn't work these days, but Naz surely has an updated link.

I think... he was making walking paths across grass, or sand beaches around a lake... I can't remember.

All in all, this question is much too complex for MY intelligence levels.  Hopefully, others will comment soon.  Stay tuned.

Um... we might want to avoid the Blender stencil method and try another way.  That "convert to 1024" is unwanted, I think.

TF, do you want to make roads IN-SCENE?  Allow user to "draw" or "paint" roads?  Just curious.  :)  haha... Naz just asked same question while I was editing this post.  :D  Psychic!

Link to comment
Share on other sites

  • Wingnut unfeatured this topic

Sorry for not complex question.

I want to paint road on ground. Using stencil it is visible, but in very bad quality, so i decided to put texture on ground using BJS and then i have problem with paint a road on my ground.

I have one thought maybe i should make custom mesh and add to it texture of road? What do you think?

Link to comment
Share on other sites

Hi again, TF, thx for added info.

I have two playgrounds bookmarked... when I searched for "paint" in my bookmarks DB.

https://www.babylonjs-playground.com/#9U086#4

Works ok, let's you drag mouse around on dynamic texture.

http://playground.babylonjs.com/#YQ4GPC#1

I think this is an old shaderbuilder demo.  I think its reference images are 404. 

Let's ask @NasimiAsl if he has seen a newer version of that.

I think @Dad72 did some "paint-on-texture", and also @joshcamas.

Maybe others, too.  Let's keep listening to comments.  Maybe a forum search for "paint on" or something? 

The Blender stencil system might be fine, and might be output-size adjustable, but I have no experience with that.  Sorry.

Link to comment
Share on other sites

6 hours ago, TomaszFurca said:

Sorry for not complex question.

I want to paint road on ground. Using stencil it is visible, but in very bad quality, so i decided to put texture on ground using BJS and then i have problem with paint a road on my ground.

I have one thought maybe i should make custom mesh and add to it texture of road? What do you think?

Maybe this? 
http://doc.babylonjs.com/extensions/terrain
Using terrain material you can paint you ground as you wish

ps: It's not fair, I want to report a few users, like @aWeirdo, ... they are too fast for me :D

Link to comment
Share on other sites

Oh, guys... that's height-based texture blending?  Nice.

Won't work for roads, though... I don't think.  If roads were hilly... texture would be different at bottom/top of hills.  If TF's texture didn't have hills, then it IS a possible solve.  TF would make all his roads... at a slightly lower or higher height... than the rest of the terrain?

Then the road-drawing tool... would be a heightMap vert-elevation adjuster?  hmm.  We HAVE seen some paint-on elevation demos for heightMap "drawing"... but I don't know if TF would WANT roads to be slightly higher or lower than the other terrain.  (TF... for example... any vertex point on the heightmap that has an elevation (Y)... perhaps between -1 and -2... would be painted in gray asphalt color.)

*shrug*  Like I know anything I'm talking about.  :)  I could be well lost. 

Link to comment
Share on other sites

@Wingnut I hope I understand your idea.
So here is a demo:
http://playground.babylonjs.com/#9MPPSY
I did something similar a few time ago, but I modify terrainMaterial shader to accept 8 different textures. How it works: you upload your rgb mix map with your design, assign it to a dynamic map and after that paint the dynamic map with one of rgb colors. It looks great with more than 3 colors, but it works with 3 too. :D

Link to comment
Share on other sites

  • 2 weeks later...
On 3/14/2018 at 10:29 AM, MarianG said:

@Wingnut I hope I understand your idea.
So here is a demo:
http://playground.babylonjs.com/#9MPPSY
I did something similar a few time ago, but I modify terrainMaterial shader to accept 8 different textures. How it works: you upload your rgb mix map with your design, assign it to a dynamic map and after that paint the dynamic map with one of rgb colors. It looks great with more than 3 colors, but it works with 3 too. :D

Yup, this is exactly what you need to do! Interestingly enough, this is how most engines do it, such as Unity and UE4. :)

This was what I wanted to do years ago with my editor, but back then we didn't have that nice terrainMaterial, so beautiful <3

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.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...