maps in shader for replicator distribution channel stopped working

DiomedeDiomede Posts: 15,173
edited December 1969 in Carrara Discussion

Aaargh. This is very embarrassing considering that I demonstrated how to make this work, with an effective example, in another thread. For some reason, my Carrara is not applying the limits defined in a texture map designed to control the location of objects on a surface. I discovered this while trying to apply it to a terrain. However, I have done a couple of tests just to confirm that it has stopped working.

In the attached screenshots, I have a terrain distribution map that I made in photoshop and saved as a tif file. It is just a black field with white dashes on it. I applied the map to a simple vertex grid just for the example. The objects are simple spheres. In the surface replicator modeling room, I checked the box to edit the shader and loaded the map (the tif file saved from photoshop). I also applied the map to the grid just so you could see where the objects are supposed to be placed. I've increased the distribution precision to best.

It isn't working.

Hmmm.

3_surface_replicator_room.JPG
665 x 420 - 40K
1_render_rreplicator_b.JPG
566 x 327 - 47K
1_render_rreplicator.jpg
640 x 480 - 14K

Comments

  • DUDUDUDU Posts: 1,945
    edited December 1969

    Is it a .TIF with alpha ?
    I had this problem too...

  • DiomedeDiomede Posts: 15,173
    edited December 1969

    Is it a .TIF with alpha ?
    I had this problem too...

    Yes, it is a .tif file. I had not been using .tif until I watched the Mark Bremmer tutorial in which he used it. Did converting the file to jpeg or bmp fix it for you, or did you have to make the map over again? I just tried converting it to jpeg and it still did not work.

  • DUDUDUDU Posts: 1,945
    edited March 2014

    In .jpeg, that work but my C8 don't want .bmp...
    Try .tif without alpha ?

    EDIT: .bmp is working...

    Post edited by DUDU on
  • DUDUDUDU Posts: 1,945
    edited December 1969

    .tif without alpha is working for me but not with alpha...

  • DiomedeDiomede Posts: 15,173
    edited March 2014

    .tif without alpha is working for me but not with alpha...

    Thank you. I was getting ready to uninstall and reinstall.

    Post edited by Diomede on
  • DiomedeDiomede Posts: 15,173
    edited December 1969

    diomede64 said:
    .tif without alpha is working for me but not with alpha...

    Thank you. I was getting ready to uninstall and reinstall.

    Sorry, another follow up. How do I make sure the file is without alpha in the save? I checked the opacity. It says 100%. I have flattened the image. I have saved it as a jpeg. I have explored the save as menu. I've looked through preferences.

  • DiomedeDiomede Posts: 15,173
    edited March 2014

    diomede64 said:
    diomede64 said:
    .tif without alpha is working for me but not with alpha...

    Thank you. I was getting ready to uninstall and reinstall.

    Sorry, another follow up. How do I make sure the file is without alpha in the save? I checked the opacity. It says 100%. I have flattened the image. I have saved it as a jpeg. I have explored the save as menu. I've looked through preferences.

    Sigh of relief. I had alpha background as default in my file creation. I think I have it fixed. Thanks for your patience. Like I said, I'm pretty embarrassed. :red:

    finally_working_again.jpg
    640 x 480 - 14K
    Post edited by Diomede on
  • DUDUDUDU Posts: 1,945
    edited December 1969

    It's the history of a pupil who learns to his teacher...:-)

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    Some other things that can cause odd behavior with following a distribution map is to have the distance between objects too large, or not enabling the shading domain option on multiple domain objects with a distribution map- Even though the map covers all the domains. That last one threw me off for a bit.

  • DiomedeDiomede Posts: 15,173
    edited December 1969

    Here we go again.

    I've tried saving as a tif, jpeg and bmp. I've tried merging down layers in photoshop. I've tried opening the file in Paint and saving it in various formats. I've tried repainting it from scratch so I could be sure that there were not multiple layers. Carrara will not use the following image as the controlling texture map for a surface replicator. I am attaching two different versions of the same basic image. Neither worked. I have half a dozen more versions, but you get the idea.

    Please, someone show step-by-step how to get a Photoshop black and white file to be created without alpha, saved without alpha, and imported into Carrara's surface replicator so that it works.

    road_through_dont_fence_me_in_3.jpg
    257 x 257 - 26K
    road_through_dont_fence_me_in_2.jpg
    257 x 257 - 27K
  • DiomedeDiomede Posts: 15,173
    edited March 2014

    oops - Dudu tried to tell me so many times. There is a checkbox right there. Choose the one without "alpha." :red:

    embarrassed_2.jpg
    708 x 539 - 232K
    Post edited by Diomede on
  • DUDUDUDU Posts: 1,945
    edited December 1969

    Yes, and you have also the option of export in PS…

  • DiomedeDiomede Posts: 15,173
    edited December 1969

    Nope, still not working. Aargh.

    Here is a screenshot within Photoshop. I copied and pasted the photoshop file into a new photoshop file and there were little white dots all over the place. My guess is that has something to do with my problem. If those little white dots are being picked up by Carrara, that would explain why it doesn't seem to be working.

    I exported the heightmap from Carrara again to start from scratch. Using only a background layer, no new layers, I painted a white line where I wanted, then painted everything else black. Just for good measure, I used the paint fill can set to black on the black areas just to make sure. I saved it in various formats and imported into Carrara's surface replicator distribution channel as shown above in this thread. No luck.

    As a test, i created a new blank file in Photoshop. I selected the first image (the one exported from Carrara and then painted) and then copied and pasted it into the new file. Little white dots appeared in the new image. I'm not sure if they will show up as the attachment so you may have to click and enlarge.

    I have attached screenshot that points out the white dots in Photoshop. the original file with no white dots is also there.

    ??????????????????????????? aaargh ??????????????????????

    white_dots_jpeg.jpg
    767 x 559 - 58K
  • DiomedeDiomede Posts: 15,173
    edited December 1969

    just so people can see that I am not crazy, here are screenshots of the result (cubes everywhere), of the settings of the surface replicator, and the settings of the shader within the surface replicator (the black/white texture map is plainly visible).

    shader_settings.JPG
    650 x 450 - 58K
    2_surface_replicator_settings.JPG
    693 x 346 - 35K
    1_distribution_fail.jpg
    1600 x 1000 - 197K
  • DiomedeDiomede Posts: 15,173
    edited December 1969

    aargh time 2.

    As a test, I imported some of the files that won't work as distribution maps in other roles. They work as textures. More confusingly, they work as heightmaps for the terrain editor. That is right. the terrain editor heightmap interprets it correctly, but the surface replicator does not.

    Here you can see the terrain editor interpret the line in the above images as a curving ridge.

    arch, argh, argh.

    as_heightmap_aaargh.JPG
    579 x 446 - 26K
  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    I suspect the one with the dots is because you converted an image with gradations to .bmp. I had this issue when I illustrated a book some years ago. The publishing house wanted the images in .bmp format for some bizarre reason. When I converted the Photoshop file to a black and white .bmp, I had little freakin' speckles everywhere.

    So, my question is, have you been saving these different versions with different file types from the same original image, or are you trans-encoding? Also, are you sure black is pure black?

    Maybe what you think is the distribution shader isn't the one used by the replicator? I had that happen to me somehow once. Maybe something isn't set up in the replicator? Have you tried to re-export the height map from Carrara and start from scratch in case it's a corrupted file? Have tried deleting the original replicator and starting with a new one?

  • DiomedeDiomede Posts: 15,173
    edited December 1969

    Thanks for the suggestions EP. Yes, I've started over, etc. You have a good list there. I will make sure I have tried each.

    However, I can't figure out why the following isn't working.
    1) Opened new file. Loaded terrain from object browser. Went into terrain modeler and exported the map as a .psd file.
    2) Opened Photoshop. Loaded file exported from terrain modeler.
    3) Painted black and white directly on the map to create a white line on a black background. (Just to make sure layers wasn't being a problem.
    4) Saved the white/black file as a .tif file.
    5) Back in Carrara, inserted a sphere and a surface replicator. Set the surface replicator to apply spheres to the terrain.
    6) In the surface replicator distribution channel, checked used shader.
    7) In the shader, set to multichannel and set to texture map. Loaded the .tif file exported from PS. made sure the color only box was checked.

    You can see the progression in the attached pics. Doesn't work.

    Argh.

    2b_aargh_settings.jpg
    600 x 800 - 206K
    1b_aargh_settings_PS.jpg
    500 x 700 - 97K
  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    For my part, I usually export as a .png or .jpg, and then open it in PS. I then add a layer and paint on that in case I screw up. When I'm done, I Save As and choose either .png or .jpg. Your mileage may vary. ;-)

  • DiomedeDiomede Posts: 15,173
    edited December 1969

    Consider this a message in a bottle for some future frustrated soul who finds this thread through a forum search.

    I managed to "solve" the problem by opening the black/white file in Paint (the simple art program found in a PC's accessories folder), then saving it back out. Nothing else. No editing. No changing format.

    Sometimes, better off not to ask why.

  • DiomedeDiomede Posts: 15,173
    edited December 1969

    For my part, I usually export as a .png or .jpg, and then open it in PS. I then add a layer and paint on that in case I screw up. When I'm done, I Save As and choose either .png or .jpg. Your mileage may vary. ;-)

    Yes, I had been trying that. Don't understand why it didn't work. For some reason, Paint has decided that it is the gatekeeper for replicator distribution maps.

  • 3DAGE3DAGE Posts: 3,311
    edited December 1969

    HI diomede64 :)

    I think the issue is connected to the way you're setting up the shader (multichannel)

    Try setting the shader to Projection mapping / Flat mapping / then select the "Top Box" of the little box icons (see pic)

    As for the Photoshop white dots,. that's probably a format conversion issue as Evilproducer mentioned,

    Work-flow should be something like this

    Export terrain map, as PSD if you're using photoshop.

    Use the "magic wand" selector, (or another selection tool),. to select the area you want
    Create a new layer.
    Use Edit / Fill to fill the selected area with White or Black.

    you can create a New layer, filled with black as an Under-layer if needed.

    Export your B/W distribution map as JPG or PNG

    (remember that the imported distribution map will need to be rotated to fit the terrain)

    JPG and PNG are both much smaller in file size than Tiff or BMP

    Save your Photoshop file (with all your distribution or texture layers)
    Layers are your friend :)

    Hope it helps :)

    Dist_map_shader.jpg
    1651 x 967 - 256K
  • DiomedeDiomede Posts: 15,173
    edited March 2014

    3DAge! Thanks for the suggestions.

    My computer has been taken over by fans of Tron (original version). Paint is the master controller. I have to use Paint or the replicator won't work. And if i use Paint, multi-channel works fine.

    I tried using the projection mapping and the PSD workflow. No dice. See attached.

    flat_not_working.JPG
    652 x 450 - 54K
    flat_mapping_set.JPG
    645 x 394 - 39K
    Post edited by Diomede on
  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    I can see a denser line of objects, so something is happening. What are the settings in the replicator?

  • DiomedeDiomede Posts: 15,173
    edited December 1969

    I can see a denser line of objects, so something is happening. What are the settings in the replicator?

    I already exited the file, but I'm sure the settings were similar to post #17 above. I've tried the same basic approach with lots of file types and lots of settings. It is a mystery.

  • tbwoqtbwoq Posts: 238
    edited March 2014

    Hi diomede64.

    I have similar issues with 'Use shader' for distribution in the surface replicator and can't find what is happening at all. Still researching and waiting to see if anyone else has this issue or more information.

    Post edited by tbwoq on
  • DesertDudeDesertDude Posts: 1,235
    edited March 2014

    Hi diomede64

    I am having trouble re-creating your problem. Reading your post (#17), and looking at the screenshots, I'm wondering if the black areas of your distribution map are really completely black, although it's a mystery why opening and re-saving in another application would solve the problem...

    Maybe try this, and apologies if you have already tried something similar:

    > Export your terrain map, open it in PS

    > Create a new layer (above the map), fill it by going to >Edit >Fill and fill with 100% black.

    > Lower this Black layer's opacity so you can comfortably see your terrain map below. Then, paint in your distribution areas with white. When finished, bring back the layer's opacity to 100%.

    > Turn off the visibility of the terrain map, (just to be sure), export image as a .jpg, then apply as your distribution map.

    Hope that helps. It can be frustrating spinning around and around a seemingly simple obstacle.

    P.S. - looks like I am repeating what 3DAGE already said...sorry

    Post edited by DesertDude on
  • DUDUDUDU Posts: 1,945
    edited December 1969

    Diomede, could you post your file for download ?

  • DiomedeDiomede Posts: 15,173
    edited December 1969

    tbwoq said:
    Hi diomede64.

    I have similar issues with 'Use shader' for distribution in the surface replicator and can't find what is happening at all. Still researching and waiting to see if anyone else has this issue or more information.

    Very sorry that you are feeling this pain with me, but at least it doesn't have to feed into my paranoia now. For a while, I really did suspect that Paint was taking control of my computer. Speaking of which, have you tried loading and exporting from Paint? If so, does it fix the replicator distribution for you?

    Thanks to everyone for making suggestions. I really do appreciate it. I haven't saved the files that didn't work because they were just practice sessions to learn replicator skills. However, I'll try to do another walk through with screen shots this weekend. I should point out that the other functions of Carrara that use these maps work fine. That is, I can use a map exported from Photoshop in the shader opacity mask channel to control the shader on a terrain, however, I can't use that same map to control the replicator distribution shader on that same terrain. Very bizarre.

    Dudu - I'll save a file this weekend to post. How/where do I post a Carrara file? Maybe at carraracafe?

  • tbwoqtbwoq Posts: 238
    edited March 2014

    diomede64 said:
    tbwoq said:
    Hi diomede64.

    I have similar issues with 'Use shader' for distribution in the surface replicator and can't find what is happening at all. Still researching and waiting to see if anyone else has this issue or more information.

    Very sorry that you are feeling this pain with me, but at least it doesn't have to feed into my paranoia now. For a while, I really did suspect that Paint was taking control of my computer. Speaking of which, have you tried loading and exporting from Paint? If so, does it fix the replicator distribution for you?
    ...

    Yes, Paint seems to work fine in further testing(don't have Photoshop yet). However, there still seems to be an issue with the number of objects not being fully distributed on some maps no matter what the minimum distances(etc.). I have to use/force more objects to fill some maps.

    I've been experimenting with Carrara's 3D Paint feature to better understand its connections to the shader room. This could be one of the reasons I had issues with map distributions or that I'm using a feature in a way it wasn't intended. I did find that terrain exported height maps don't match terrain filters exactly. Maybe theres a connection there(?). Without better documentation there has also been alot of, "ahhh,... I was doing that wrong" moments. :)

    Post edited by tbwoq on
Sign In or Register to comment.