Home Technical Talk

Photoshop - average blur within a selction area.

polycounter lvl 17
Offline / Send Message
SHEPEIRO polycounter lvl 17
I often use a technique...

make ceramic tile texture... make normal map... (from high or just CB or heighmap)
then to give each tile slight normal offset i creat a cloud height map, convert to normal map then select each tile and average the cloud normal giving each tile a slight offset...works really nice with acute lighting...


ATM im making a rather large set of tiles... and i dont fancy selecting each tile and applying an average bluf filter to each...maybe 300+ tile...

so is there a way to blur keeping each of the selection areas seperate and NOT average across them...

ive done a few at the top here to show you what i mean.... and have a saved selection for all the tile surfaces.

cheers you great people you
norms.JPG

Replies

  • SHEPEIRO
    Options
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    no i have the tiles selected as a whole so i could go through them and select each one and average.. but i have 300+ in this texture (x 4 clicks of the mouse etc = a fuck load of time) and i do this fairly often so im trying to find if theres a more time efficient (and less ball busting) method
  • SHEPEIRO
    Options
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    absolutely...
    got it down to one click and a hot key combo...but its stil RSI work
  • Autarkis
    Options
    Offline / Send Message
    Autarkis polycounter lvl 8
    I've been scratching my head trying to figure out how to do what you're asking for, and I really do not see a way for photoshop to average your values within each individual tiles across all your tiles in one sweeping move. However, just thinking out loud here, but since you're saying that you have a high poly done, you could always have in any 3d package select a random color ID to each tile ( if you're just using chamfered boxes in your 3d package to bake that HP from( and then just use those as selection masks inside photoshop to assign new normal colors? I think what i'm trying to say is getting pretty confusing, but it makes sense to me ;)
    You're not gonna get that ultra randomness you're getting now ( well it all depends on how many ID colors you have) but still, better than to select a hundred tiles or more and do an average blur?
  • SHEPEIRO
    Options
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    in this instance i was working from photo...but i do do it for HP too...although then i do usually djust do a slight random rotation on all the tiles...sorry friday explanations......pub is calling

    i did this one by hand...took about ten minutes constant clicking...and while thats not long...its alot of repetition for something that SHOULD be easy.
  • Wrath
    Options
    Offline / Send Message
    Wrath polycounter lvl 18
    Did something identical about a year ago for a pattern of shattered glass. Selected every shard individually by hand and ran an action to make randomly perturbed normals using average blur.

    I think automating that kind of process would require a script. Cant' see how to get around not needing some sort of conditional logic. Have you looked into this?
    http://www.adobe.com/devnet/photoshop/scripting.html
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Thinking of how to go through the selections faster. One way would be to make cutouts of each tile distributed among layers and just iterating through those layers but at this rate might as well click each one :( Unless someone knows how to store selections into an array (dont think photoshop has anything but looking through the docs)
  • Mark Dygert
    Options
    Offline / Send Message
    Autarkis wrote: »
    I've been scratching my head trying to figure out how to do what you're asking for, and I really do not see a way for photoshop to average your values within each individual tiles across all your tiles in one sweeping move. However, just thinking out loud here, but since you're saying that you have a high poly done, you could always have in any 3d package select a random color ID to each tile ( if you're just using chamfered boxes in your 3d package to bake that HP from( and then just use those as selection masks inside photoshop to assign new normal colors? I think what i'm trying to say is getting pretty confusing, but it makes sense to me ;)
    You're not gonna get that ultra randomness you're getting now ( well it all depends on how many ID colors you have) but still, better than to select a hundred tiles or more and do an average blur?
    I'm not sure I fully understand what you want to do but I'll try to clarify because my idea seems pretty similar.

    If this was baked from geometry can you apply a specific set of colors to the brick and render out flat color masks with 100% self illumination. Then set up some kind of photoshop action that operates on those colors? "Select by color red, blur average, select by color green, blur average".
    OR
    "select by color, create layer from copy" so they all get separated out to different layers/masks?

    That would require some leg work and syncing of colors in the 3d app to photoshop, but if you have to do it to a lot of tiles it could help automate the process and if the specific colors can be applied randomly in the 3d app, then you could run it a few times to get more mixed results and mix and match from what seems to work the best.

    Even if its not caputured from high poly geomerty you could still select and create specific color groups, I guess...
  • Autarkis
    Options
    Offline / Send Message
    Autarkis polycounter lvl 8
    That's exactly what i was trying to come across as saying Mark. Sorry it was early in the morning from me, typing it from the airport.. and yeah, i knew it was going to get confusing ;)
  • Internet Friend
    Options
    Offline / Send Message
    Internet Friend polycounter lvl 9
    I haven't tried this, but the first solution that comes to my mind is to render out a color mask with the tiles all one color, then use an AutoHotkey script with the PixelSearch function to search for that color and Click with the magic wand tool to select it, then run a photoshop Action to switch to the normal map and average blur. Loop until PixelSearch returns ErrorLevel 1 and it should do the entire screen.
  • MasteroftheFork
    Options
    Offline / Send Message
    MasteroftheFork polycounter lvl 18
    Can't you just use the fill tool and just vary the colour a tad each poor then normalize it at the end?
  • AzzaMat
    Options
    Offline / Send Message
    AzzaMat polycounter lvl 9
    assuming all the bricks are the same size and forgive me if this is wrong because I only skimmed it, but couldnt you just create an action in photoshop thats does that action to one row and then drops the selection box down one and then just play that action over and over until the job is done? that way you would only have to click once to do each row, if you dont know how to do an action I can put up a quick tutorial on how to do it
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    AzzaMat wrote: »
    assuming all the bricks are the same size and forgive me if this is wrong because I only skimmed it, but couldnt you just create an action in photoshop thats does that action to one row and then drops the selection box down one and then just play that action over and over until the job is done? that way you would only have to click once to do each row, if you dont know how to do an action I can put up a quick tutorial on how to do it

    The problem with that is that you need to individually click each selection and average blur. If you select more than one tile, they all get the same average blur.
  • AzzaMat
    Options
    Offline / Send Message
    AzzaMat polycounter lvl 9
    sorry I might not have been clear enough but re-reading my original message I can see why you though that, I worded it very poorly.The way the action command would work is it would select one brick, average blur then move onto the next brick along, This means it would only average that brick and none of the others would be taken into account. if you were to record yourself doing one row and then moving the selection field to the tiling brick bellow it you could do the entire image by just clicking the play button a few times
  • AzzaMat
    Options
    Offline / Send Message
    AzzaMat polycounter lvl 9
    [URL="http://imageshack.us/photo/my-images/8/brickblurtechnique.jpg/"][IMG]http://img8.imageshack.us/img8/7898/brickblurtechnique.th.jpg[/IMG][/URL]
    
    Uploaded with [URL="http://imageshack.us"]ImageShack.us[/URL]
    
    here is the image at the top but all nice and averaged per brick, apart from a few i left the top ones and I missed the corner bricks by accident. It actually took me longer to figure out how to upload it than it did to do the entire process including recording the action. for some reason my normal means of uploading weren't working
  • Internet Friend
    Options
    Offline / Send Message
    Internet Friend polycounter lvl 9
    The trouble is you'd need a new action any time you make a new size of tile, and it won't work for irregular shapes. An AHK script would work on any size tiles, regular or irregular.
  • Adam L. Gray
    Options
    Offline / Send Message
    I'm sorry to say, but wouldn't it just be more simple to start over. And then create a new normal map, rendering the grit depth from a high poly mesh and adding any noise you would like afterwards?

    Sorry I couldn't be of more help here, but don't think you'll get a very proper normal map out of it, without doing a shitload of work.

    Alternatively, if you have a diffuse for it. You could try spiking the levels and see if you get a reasonably good enough 'select colour' mask out of it.

    Cheers
  • Valandar
    Options
    Offline / Send Message
    Valandar polycounter lvl 18
    And... wouldn't that just affect the apparant angle of each brick, not the apparant height?
  • Scruples
    Options
    Offline / Send Message
    Scruples polycounter lvl 10
    That's what he is trying to do, just change the angle slightly.
  • Millenia
    Options
    Offline / Send Message
    Millenia polycount sponsor
    perna wrote: »
    Hehe.. yeah, this. Why not just make the hipoly correct in the first place? At 3Point we never modify normal maps as that usually ends up being the slower and more workflow-breaking solution.

    But you 3p types are machines and the rest of us are but mere mortals ;________;
  • fanfare
    Options
    Offline / Send Message
    i know this is a very old thread, but i ran into this issue tonight and have a solution using photoshop-only that might be of interest to anyone that runs across this thread in the future.. (since it is the top of google for this issue)
    you can achieve this by using photoshop's 'lens blur' instead of 'average'. select the different regions you want, then set a HUGE value in the lens blur 'radius' setting, and apply. and if your selection is bigger than the radius available with lens blur, apply the lens blur a few times.
Sign In or Register to comment.