I am using 3dsmax's Render to texture to transfer Normal, Diffuse, Spec and lighting maps from my detail mesh to my render mesh. Problem is that there is no "bleeding" of textures past the UVs so when I view the model in engine. I see the seams all black and ugly when it gets mip-mapped. I was told that there is a plugin for photoshop that will look at each layers color information and find the "borders" (areas with no color information on the layer) and fill the area around the borders with what ever the closest color to the border. Hope that made sence. So it would like grab all the pixels on the borders of a layer and stretch it so many pixels. I was wondering if any of you know about it or where I could find it.
Also, is there like a rule of thumb to follow when bleeding textures past UV borders so you cant see seams when a texture is mip-mapped? Like if the texture is 1024x1024 make sure you bleed the textures "___" pixels past the border, if the texture is 512x512 bleed the textures "___" pixels past the border.
Or am I talking crazy and everyone is scratching there heads thinking wtf is he talking about?
Replies
Also both Pior, and myself made photoshop actions that would do what you want, mine is at work, but I'll upload it tomorrow.
Try changing the "Edge Padding" number in the RTT dialog window - I think default is 2, maybe you should try it higher.
As for using Photoshop, you can do this using the Maximum (or Minimum, I always get those two mixed up!) filter.
Just select your unused space, grow the selection by 1 pixel (so it's only selecting the very outer row of pixels on all your UV borders, then do a Maximum (or Minimum) filter on it, set to an appropriate number - 2 or 3 usually does it for me.
Edit: And yes, Poop beat me to it, but that reminds me - I used to save out Max RTT things from the preview window, and always wondered where the edge padding went. It saves it on the hard drive, but doesn't show it in the preview window, so maybe that's what you're doing...?
For the first part of your question : what I'd do is grab the magic wand, set it to zero tolerance and no blending, and selct the outside bit of the UV chunks (or maybe max esports alphas with rtt? not sure)
>ctrl+i to then invert the selection
>ctrl+j to duplicate its content, two times
>blur the lower copy a bit (small gaussian blur will do)
>and make multiple copies of the blurred layer to thicken all that. That should do it... You can then do it again with a larger value.
I did an action for that some time ago, I've also herad someone else did it before... But hey that can be quickly done by hand anyways.
As for the second part of your question, well I guess it depends on how close together your UV chunks are?
Hope this helps
http://www.ericchadwick.com/examples/files/uv_edge_filter.zip
Poop I'd like to see what you did. Different from pior's approach?
Works better with CS & PS7 (thanks Jay!).
Fixed when current layer != Front layer.
Added comment about non-AA selection.
Fixed layer-naming problem.
This. This fixed it for me. Graaaaah, bloody Max
I've just been looking for ways to improve my edge-bleeding Photoshop macro, but just getting RTT to save my textures did what I needed!
I thought I'd better thank this three-year-old thread
also congrats on your new first post, may it be the start of a whole new era of guplicity!
You already have some answers, but I will share my method: The edge padding function of Render To Texture should do this for you.
The rule of thumb I use for calculating edge padding is this:
Ask youself which mip map level you expect the model to be seen at in game, for the majority of cases.
Over the years, I have found that A good rule of thumb is an asset (such as a character,) has to look good all the way through to the 128x128 mip level.
Therefore, you need at least 2 pixels of edge padding at 128x128, IF you can guarantee that your UVs are snapped directly to the pixel boundaries of your UV space. (More on this later...)
Therefore, if your texture size is 1024x1024, you need account for 16 pixels of edge padding at 1024x1024.
Now: Snapping to pixels. The best way to ensure that your UVs are snapping directly to pixels is to enable the grid and grid snap in the UVW Unwrap dialog. Then, set your grid spacing to a size equivalent to the number of pixels in the map. This is easily done by dividing UV space by the number of pixels: 1.0 / 128pixels = 0.0078125 grid. Now with grid snap enabled, as long as you snap your UVs to the grid, you can be sure you are snapping pixel by pixel.
I use this method extensively. So much so that I have expanded my UVW Unwrap dialog to include a set of buttons that automatically set the grid space to pixel density equivalents from 8x8 up through 4096x4096!