Help - Search - Members - Calendar
Full Version: Plugin: Roads
Hash, Inc. Forums > Technical Direction and Development (Learning Animation:Master) > A:M Rendering, Compositing and Special Effects > Materials Laboratory
ZPiDER
hey there!

a while ago i promised a texture that will render coloring based on proximity to a spline. i finally got around to do it smile.gif
you can use it to lay roads onto a landscape with only one spline or to add other kinds of detail.

[attachmentid=17736]

the above picture uses three instances of the Roads material:

[attachmentid=17738]

the model looks like this:

[attachmentid=17737]

this is the first plugin i coded, that directly takes model data into account for rendering. typically matrials only are aware of the camera position, the surface position, and normal data.
i think some very powerful texturing tools could be created by letting model geometry influence the texture look. any ideas for that?
ddustin
QUOTE(ZPiDER @ Jun 27 2006, 03:46 AM) *

hey there!

a while ago i promised a texture that will render coloring based on proximity to a spline. i finally got around to do it smile.gif
you can use it to lay roads onto a landscape with only one spline or to add other kinds of detail.

[attachmentid=17736]

the above picture uses three instances of the Roads material:

[attachmentid=17738]

the model looks like this:

[attachmentid=17737]

this is the first plugin i coded, that directly takes model data into account for rendering. typically matrials only are aware of the camera position, the surface position, and normal data.
i think some very powerful texturing tools could be created by letting model geometry influence the texture look. any ideas for that?


That is fantastic!
1. Where can I get it?
2. Can it do multiple lanes?
3. Can it do intersections?
4. Can it do turning lanes?
5. Where can I get it?

Outstanding work.
David
ZPiDER
1)
here you go.

but be careful while testing it!
it can currently only handle ONE spline.
group this spline into a named group.
it can currently also only handle ONE step count value (all instances you make need to have the same value! - see screenshots above (500))

2)
yes, you can specify any gradient you'd like.

3)
theoretically yes, as long as its the same spline

4)
it only works in a very simple fashion. any point close to the spline will show a color left of the gradient, more distanced points will render a color more to the right, until the distance grows above the specified width.

5)
see 1)
c-wheeler
Ohh WOW

thankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankoutha
nyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthanko
uthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouth
ankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthany
outhankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankout
hanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthan
kouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyou
thankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankoutha
nyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthanko
uthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouth
ankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthany
outhankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankout
hanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthan
kouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyou
thankouthanyouthankouthanyouthankouthanyouthankouthanyouthankouthanyouthankoutha
nyouthankouthanyouthankouthanyou
Kamikaze
Thanks a bunch ZPiDER,

Michael
jpappas
Thanks Marcel, this plugin looks like it has many possibilities! Can't wait to try it out. :-)

QUOTE(ZPiDER @ Jun 27 2006, 02:46 AM) *

i think some very powerful texturing tools could be created by letting model geometry influence the texture look. any ideas for that?


Does this include being influenced by things like the height of the model? I've always thought it would be great to have a material that you could add to a mountain model, and the material makes the high parts have a snow texture, while the lower parts have a rock texture, just as an example. Or another idea is making flat parts of a model have a certain texture while more vertical parts of the model have a different texture, etc... You can tell I've got landscape texturing on my mind. ;-)

-Jim
Zaryin
Hey Marcel, amazing plug-in! THanks alot.

My question is the same as Jim's. Wasn't sombody working on a normal surface plug-in or something that could be used to texture terrain well?
robcat2075
QUOTE(ZPiDER @ Jun 27 2006, 05:46 AM) *

i think some very powerful texturing tools could be created by letting model geometry influence the texture look. any ideas for that?


QUOTE
Or another idea is making flat parts of a model have a certain texture while more vertical parts of the model have a different texture, etc...

A while back someone proposed a "slope" combiner. Yes, that would be useful.


QUOTE
I've always thought it would be great to have a material that you could add to a mountain model, and the material makes the high parts have a snow texture, while the lower parts have a rock texture, just as an example.
Gradient combiner does that now
ZPiDER
QUOTE(jpappas @ Jun 27 2006, 09:15 AM) *

Does this include being influenced by things like the height of the model?


yes, thats definitely a possibility.

or the pivot of the applied group (read: auto positioned eye ball texture)
rodger_r
The attached image shows an inset close-up of one of the end abutments for my concrete railroad bridge. I added the streaks of grime by building a procedural dirt streak material (Fractal Sum with a large Y scale), rendering it on a flat plane and then using that image as a decal applied to the flattened model.

I did it this way because once you have a material that has a distinct "aim" (for instance along the Y axis), to give it the proper orientation in any given plane you have to rotate the material instance within each group and of course you get a discontinuity in the streak pattern at each group boundary.

It would be have been more convenient if I could have aligned the procedural streaks to follow the spline direction within the model. In this particular case, I would want the app to use multiple selected splines, starting at one end and smoothly transitioning to the other end.

I realize this is not a trivial programming request, but you did ask for suggestions.
Rodney
Most A:M Users are smarter than me but just in case...
Make sure you extract the Road Plugin to your Textures directory.

Example:
C:\Program Files\Hash Inc\v13\Textures

Extracting it to the HXT folder doesn't do diddly. wink.gif


Thanks for yet another cool plugin Marcel! smile.gif
ZPiDER
my GradientZ texture can actually do this landscape stuff (coloring based on slope or coloring based on height, etc.). i'll probably add the height auto detection there..

but GradientZ will not work as a combiner. since those can only be influenced by position, because they are using turbulences. Turbulence Plugins implement the Evaluate method of the Turbulence class (see ftp://www.hash.com/pub/Sdk/AMSDKDoc/classTurbulence.html ), so i cannot get a hold of the model from there. however, i have thought before about "sending" data into a turbulence (e.g. via a socket) from an associated Texture plugin, so turbulences would become more powerful ..

Rodger,
i think, what you want should be possible even without the model actually influencing the texture, but it will only work on structures with flat surfaces: the mapping of the texture would be chosen based on the found surface normal. the problem i see: i cannot use existing materials or textures with this approach, so the plugin should be able to do quite a lot by itself .. maybe i'll extend my BitMapPlus texture plugin to support that.

but you bring up a very interesting application for texturing based on model data: grime. on concrete as in your example, grime is typically very non-uniform. it does typically start at edges or at intersections with steel (screws, rails, etc.). to test this i'll add a mode to Roads that will add grime to a texture based on "sources" you'll supply it with in the referenced group.
itsjustme
Extremely cool, Marcel! Thank you!
trajcedrv
Marcel, amazing stuff, as always! Thank you!
rodger_r
QUOTE
...i'll add a mode to Roads that will add grime to a texture based on "sources" you'll supply it with in the referenced group


Cool!
ZPiDER
well, this turned out pretty neat, i might actually rename the plugin or create a spin-off smile.gif

[attachmentid=17776]

i'm currently using a fixed multimplier for the width in the "downward" direction. if there is demand, i'll add an input.

[attachmentid=17775]

unzip to a:m/textures/Roads.atx, restart a:m
the limitations mentioned before still apply, except in the new application mode "steps" will be ignored. i might though make it iterative, so it will be of use again later ..
Zaryin
That is seriously cool. Thanks alot for this. And I know Roger is going to love it, haha.
ZPiDER
QUOTE(Zaryin @ Jun 28 2006, 08:55 AM) *
And I know Roger is going to love it, haha.

well i hope so! rodgers so often managed to inspire and motivate me to do stuff, that i'll be happy to give back something smile.gif

something i forgot to mention:
to get an update of the rendered view you'll sometimes need to move the timeline to any other time, render there, move back and render there. i usually just keep the quickrender on while doing mats, when you do that its just a matter of moving to anither frame and back. the reason for this is this:

when i'm getting a different time value, i rebuild all caches to save a lot of time while rendering. so the old cache might still be sticky when you are rendering the same time again.

i hope to get this ironed out in the final version however.
ZPiDER
i've implemented another mode for the plugin: "exposed areas of group".

this mode places a "polisher" in random positions around the group. if this polisher only finds one cp in range, it will consider this random position as "exposed" and color this area. this process is repeated for a given number of steps and for each cp. you can think of it as if your model was completely dirty and you only polish off the dirt at exposed areas.

the result is another kind of grime. the one that builds up in unreachable areas.

the described algorithm is very simple and largely depends on how you've built your model, but its a nice way to get quick detail for a prototype.
luckbat
That's terrific!
rodger_r
QUOTE
...Rodger is going to love it...

Yes, I do have a certain fondness for grime and dirt and rust and chipped paint, anything that makes something look used. I once built a 1/8 scale plastic model of a Corvette and I used a torch to soften the seats and indent them so they looked more realistic.

QUOTE
rodger so often managed to inspire and motivate me to do stuff...

blush.gif

QUOTE
...this mode places a "polisher" in random positions around the group. if this polisher only finds one cp in range, it will consider this random position as "exposed" and color this area.

Marcel, I seem to be more dense than usual today and I'm not quite following your description. Would you please post a wireframe of the model so I can see the cp's and their effects? Thanks.
KenH
QUOTE

Marcel, I seem to be more dense than usual today and I'm not quite following your description. Would you please post a wireframe of the model so I can see the cp's and their effects? Thanks.


Imagine a brass door knocker. They're usually decorative with lots of crevices/valleys. This allows you to mimic the dirt in those valleys while the peaks aren't dirty....ie polished.
Nice work Marcel! I can think of lots of applications for this in TWO....eg streaks of grime running down from the windows of tincastle....or tinman for that matter.
ZPiDER
Ken is right. (as for tinman: this kind of application might require a different output channel for the plugin, i think it would look wrong on him to modify the color, but if the reflectivity was modified it could probably work out nice ..)

think of the polisher like of an actual metal polishing device: a rotating soft ball with a certain size. complex objects will often have areas which balls of a certain size cant reach.

the shown mode gives a very similar effect to this.

BUT: it depends on your models structure. if the mesh is very dense, it might not work well, the same goes for a very coarse mesh. still, my tests show that it works pretty well for quick results, a final rendering would typically use decals for this type of detail anyway.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.