Author Topic: how do i map a brick like this?  (Read 5083 times)

2020-10-08, 04:00:16

shortcirkuit

  • Active Users
  • **
  • Posts: 315
    • View Profile
Hi all

I have cutout these bricks individually and i want to scatter it across each brick element.  The bricks were modeled without the floor generator plugin and i was wondering how one would scatter each brick texture randomly on each brick mesh element?
scraping my head on this one

Thanks so much for any advice or help.

2020-10-08, 07:41:52
Reply #1

aaouviz

  • Active Users
  • **
  • Posts: 893
    • View Profile
    • Another Angle 3D
Good question - I've also stumbled upon this exact same problem before.

There might be an answer out there that I'm unaware of... but I would think it'd be nice to somehow (either in Corona texture node or Max Mapping options) to fit bitmap texture 'to face'. I know this might only work elegantly when each face is a 4-sided, rectangle, but it'd be a good start...
Nicolas Pratt
Another Angle 3D
https://www.instagram.com/anotherangle3d/

2020-10-08, 08:07:18
Reply #2

Mohammadreza Mohseni

  • Active Users
  • **
  • Posts: 152
    • View Profile
    • Instagram
there is some prerequisites for this:
1- each element need proper uv
2- elements need random id sets (you may want to have equal id sets to number of textures)
3- you need a map which distribute the textures properly

for first one:
if you model (bricks) does not have any proper uv you will not see the textures correctly. to do that use a script to detach elements of brick model so you have each brick separately then add uvw map modifier to each of them (you can use another script for that so this can be done in a few seconds), then attach them again. this way each element will have a proper uv. (ofcourse there are other ways to do this as well.)

script:
sel = getcurrentselection(); resetxform sel; for o in sel do addModifier o (Uvwmap maptype:4 ); collapsestack sel;

this script will resetxform your selection then add uvwmap in box type and collapse selection after using this script you can attach again and continue the process.

if you are using corona then 2 and 3 is so simple, just add "Corona Multi Map" and set its "mode" to "mesh elements" and "item count" to "number of your textures set". if you try this road you will not need the "MaterialByElement" modifier

if you use "Corona Multi Map" using "mode" set to "Material ID"  or some other plugin like "Multi Texture", you may want the "MaterialByElement" modifier (or any other script which can assign random id to elements)






2020-10-08, 10:27:14
Reply #3

shortcirkuit

  • Active Users
  • **
  • Posts: 315
    • View Profile
thanks guys so much for the response...

Mohammed, that is amazing man, im going to try that now, if i was to use REAL WORLD SCALE - how would the script go?

2020-10-08, 17:22:29
Reply #4

Mohammadreza Mohseni

  • Active Users
  • **
  • Posts: 152
    • View Profile
    • Instagram
thanks guys so much for the response...

Mohammed, that is amazing man, im going to try that now, if i was to use REAL WORLD SCALE - how would the script go?

if you you need to go with real world scale you need to change the script to this one which enable the real-world scale :
sel = getcurrentselection(); resetxform sel; for o in sel do addModifier o (Uvwmap maptype:4 realWorldMapSize:true);

but I do not recommend this for your purpose. because you want this to be object size fitting for uv to show correctly.

2020-10-08, 23:31:45
Reply #5

shortcirkuit

  • Active Users
  • **
  • Posts: 315
    • View Profile
Thankyou very much Mohammad worked a treat!!!  it is very much appreciated.

2020-10-09, 16:02:46
Reply #6

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
I will also share my take on this with a bit of an alternative method. I would suggest creating and mapping different variants of brick objects, it would be best if you would use a single "texture atlas" which all of your bricks will use through a single material. For scattering and variability, I would use Corona scatter or other similar scattering plugins/scripts, there are many that can also create brick walls.

You can benefit from using different Corona Scatter seed to make fast alterations to your distribution method (somewhat avoid pattern repetition), have better control in object translation/rotation/variability depending on how much detail you wish to achieve. Additionally, this allows for the use of Corona multimap along with element/material ID per face, you will have to somewhat randomize your source scatter object-element/face ID's for this to be achieved.

Once again there are various ways to approach this, it really depends on what's the end goal and how much quality/control/optimization you want to have over the mesh.
George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us

2020-10-10, 00:04:11
Reply #7

shortcirkuit

  • Active Users
  • **
  • Posts: 315
    • View Profile
Thanks very much George - when you say the atlas method, how do you mean exactly?

2020-10-11, 19:04:02
Reply #8

dj_buckley

  • Active Users
  • **
  • Posts: 876
    • View Profile
I've done this a few times recently.  Attached some examples.

There are a couple of methods I've used -

A).  If the model and texture are the correct scale, in theory you could slice up the model and extrude the bricks in an edit poly modifier above your UVW Map.

B).  Model the wall, apply standard brick texture, then create individual brick maps from the main texture (Slice it up in Photoshop and Export by Layer) - model a single brick, uvw map it, copy the mapped brick into the correct positions, attach the individual bricks together, create a new material using multitexture and your individual brick maps, apply this material to the extruded bricks.

The morning sun image uses method A, sliced up the geometry and bridged the holes together.  The blue sky house uses Method B.  Admittedly this brick texture is quite subtle, but in the high res version you can see the individual brick textures and it works.  As I say, I've used both methods with success.

2020-10-12, 10:31:12
Reply #9

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
Thanks very much George - when you say the atlas method, how do you mean exactly?

By texture atlas I mean the creation of a single map (usual high resolution) that includes all of UVs of all your distributable/seperate modelled bricks that you are going to scatter on a surface. You can create the map, then unwrap a single brick, "park" the islands over the surfaces you wish and repeat with the next models. I can send you a test scene with this if you wish.

Regards,
George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us