How could I choose the right bump map for my texture.

1792
4
10-12-2014 12:47 PM
KennethLindhardt
Occasional Contributor

I got 4 bump maps and each one goes a long with 5 brick textures. I’m using a fileRandom on my 20 brick textures, to assign em to my wall tiles. How can I make CE choose the right bumpmap to my textures. I can rename em all to make it match, but I defiantly don’t want the wrong bumpmap to my brick texture.

0 Kudos
4 Replies
MatthiasBuehler
Occasional Contributor III

yeah, rename them accordingly and create some logic with the CGA string functions.

e.g.

choose a random texture, get the base name, then create a logic that maps the chosen texture name to a random bump map.. should not be too hard..

m.

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

-------------------------------

Garsdale Design Limited
matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos
KennethLindhardt
Occasional Contributor

Thank you for your reply Matt. This doesn’t seem to hard, but I can’t make it to function like I want to,

I renamed my textures to start with Running. I got five of those. When I need my bump material I’ve tried to create a case where Running.surfix.jpg choose my Running bumpmap. This dos not seem to be the right way to do is, since it bring me an X.

If I use the complete filename for Mursten_Materiale, it would work, but only on that specific material of course.

attr Mursten_Materiale = fileRandom("images/Mursten/*.jpg")

attr Bump_Materiale =

case Mursten_Materiale == "images/Mursten/Running.*.jpg"  : fileName("images/Mursten/Bump/Running_Bump.jpg")

else: ("X")

0 Kudos
LR
by
Occasional Contributor III

Maybe you can use a variable (a subfolder for the bricks for example) to construct the path, then use that variable for your case switch.

like.. attr testme = listRandom("this;that;there;") --> then test for testme and pick the bumpmap.

0 Kudos
KennethLindhardt
Occasional Contributor

Thank’s. Will try to get it to work.

While writing back, I found my solution. The len function would work perfectly in my case.

BEFORE I FIGURED IT OUT!

My first idea was if it was possible to use the “len” function, or substring. But I’m not sure how or if it’s possible to do it like that. If I’m making sure that all my material layers that are connected to one bumpmap have the same number of characters, the len could maybe be a way to go, if it’s possible.

Attr Brick_Material  = asdfgh.jpg

Case len(Brick_Material) == 10 : bumpmap_1    

0 Kudos