Tidier way to apply these decals? Blended cubr projection maker

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 06 June 2013   #1
Tidier way to apply these decals? Blended cubr projection maker

I recently switched to vray and there a bug with passing an images alpha channel through a multisubtex map. Chaos group have confirmed this.

I used Neil Blevins's Blended cube projection maker script to set up the Left, R, T, B, F, B planar UV maps and falloffs.

I have a paint shader and a decal shader with the decal RGBA alpha blending these.

In the multisubtex (multisubmap in mr) I was using Object IDs to switch out my left and right bitmaps for a blank one where they weren't needed.

ObID1 - Blank Right bitmap
ObID2 - Blank Left bitmap
ObID3 - All bitmaps

So the easiest solution I see is to create a separate RGB bitmap for each bitmap just to use for the blend mask and run these through a duplicates Blend Box Projection map tree. Just wondering if anyone can improve on this?

Here is a the image with all maps showing on everything:


Last edited by MisterS : 06 June 2013 at 11:08 PM.
 
Old 06 June 2013   #2
Not sure I follow what you are trying to do. Is this all to work around a bug? What exactly is the bug?
__________________
--Pel
 
Old 06 June 2013   #3
Cheers for the reply - I'm trying to work around a bug and also trying to see if others have better ways to apply decals than using a blended cube map. Just because it gets messy when trying to apply a one size fits all solution and then switch the left or right (for example) maps off for certain objects. I.e. I don't want the cat logo on the interior side as shown in the attached image. Also I'm trying to find a way where I don't need to duplicate shaders for different objects.

I was trying a few things today - it appears that the decals (for example) will only be applied to objects that have a UVW map with the corresponding map channel. So as a test I applied my decals to my paint shader using a composite map in the diffuse channel (diffuse colour is layer 1) and decals are added on subsequent layers.

So I applied this shader to all objects regardless of whether the objects needed the decals or not. I seems that as long as I uncheck the 'tile' option and as long as I create a new unique set of 'decal UVW maps' with unique mapping channels it works and is quite a simple method in comparison to the blended cube map.

But to contradict the above - I tried then to apply a tiled bitmap as a new layer in my composite map using an unused mapping channel (just to see if the above is correct), and it seemed to apply a constant colour based on the average of the bitmap colours across the whole model i.e smudged across everything. So it seems to me that there is room for some whacky results further than the line if I adopt this approach.

Another downside is I think the render times may increase as it needs to calculate the projections for the decals separately...

I hope that understandable - I wish I had someone to bounce ideas off

Last edited by MisterS : 06 June 2013 at 12:37 AM.
 
Old 06 June 2013   #4
Sorry if I don't fully see what your are trying to do, but the Blended Box map script from Neil seems to be designed to make seamless projections of base textures, such as metal or dirt. I don't really see why you would be using it for doing decals, which need to be placed precisely. Correct me if I'm mistaken on this.

There are lots of different approaches to applying decals depending on the object and render engine you have access too. Maybe you could describe in a simpler way exactly what you want to do. Like "I have this object, and I need decal 1 on the left, decal 2 on the middle, and decal 3 on the top." Right now, just seeing the render, it's not clear to me what issue you are trying to solve.
__________________
www.psvisuals.com - 3D Visualization and Content Creation
 
Old 06 June 2013   #5
I would first texture all the base stuff, however you wish... Then for the decals how about a second set of UVs using another map channel?

Select just the polys you want and apply a UVW Map (planar onto those UVs) to them. Use the gizmo for UVWMap, or other tools to align the map. Set the mapping Channel for this second set of UVs to channel 2.


Then in the material use a Composite Map to first apply your base material with the normal UVs (mapping channel 1). Then add a second layer in the Composite Map and use a Bitmap node with your logo loaded into it. In this bitmap node set the mapping channel to channel 2 for the texture coords. Then put this bitmap nose into the second layer of the composite map.

Note that sometimes this will not display correctly in the viewport. Max will use the coords of mapping channel 1 to diaplay the decal incorrectly. But it renders right. You could display just the base texture or just the decal's bitmap to see them in the viewport.

Others may have some way to get this all to display correctly in the viewport.




__________________
--Pel
 
Old 06 June 2013   #6
You may need to download and view that big image. At least for me clicking on it does not enlarge it... Right-Click View Image in Firefox works, though...
__________________
--Pel
 
Old 06 June 2013   #7
Easiest way that I have handled this is map the decals in an unused channel out side of the standard 0-1 space and not tiled. There are multiple ways to handle this:
  • Use Unwrap and map in Ch 2 and move it to the right, or up, or down, etc 1.0 units in unwrap, so it is outside the standard 0-1 space.
  • Use UVW Map as you normally would, use a UVW Xform to move the mapping 1.0 units in desired direction, set the decal to not tiled and change the UV coordinates at the map to match the UVW Xfrom offset.
Of course there are other ways, but those are the ways I have handled it in the past.

-Eric
__________________
"The Evil Monkey hiding in your closet."
 
Old 06 June 2013   #8
Originally Posted by PiXeL_MoNKeY: Easiest way that I have handled this is map the decals in an unused channel out side of the standard 0-1 space and not tiled. There are multiple ways to handle this:

  • Use Unwrap and map in Ch 2 and move it to the right, or up, or down, etc 1.0 units in unwrap, so it is outside the standard 0-1 space.
  • Use UVW Map as you normally would, use a UVW Xform to move the mapping 1.0 units in desired direction, set the decal to not tiled and change the UV coordinates at the map to match the UVW Xfrom offset.
-Eric



Hey. Why are you moving it outside the normal 0-1 in this case? Just curious what the reasoning is.



Also, MisterS, Does your decal have an alpha channel? Make the image slightly larger and put a cropped alpha channel in it. Then the edges will be transparent. (See below, note that most browsers will not show the alpha.. download to see...)


__________________
--Pel
 
Old 06 June 2013   #9
Much appreciated for the replies guys.

Originally Posted by Decency: ...but the Blended Box map script from Neil seems to be designed to make seamless projections of base textures, such as metal or dirt. I don't really see why you would be using it for doing decals, which need to be placed precisely. Correct me if I'm mistaken on this.


so you're probably thinking just about this technique:
http://www.neilblevins.com/cg_educa...box_mapping.htm

but the decals were using this:
http://www.neilblevins.com/cg_educa..._projection.htm

My decals aren't crossing any blended falloffs so it works - it works even if they do cross if the decals are a simple band or whatever - something you can align in photoshop. And I'm trying to avoid adding materials or modifiers to specific polys/objects where possible. Though simply deleting a LEFT UVW planar map from the Right hand side objects will be a simple solution.

So as per the second link, I have one planer map for each top back side etc, which is used for decals, and dirt paint layers that have specific placement.

@Peldaddy - that's the way I tried second - and this I think is looking like a good option. Again, if I can, I'd like to use a single uvw projection for each side (or cam map) if I can. And end up with a shader that I can apply to object regardless of whether they need decals or not.
Edit - Decals do have a specific Alpha - I'll have a look at fixing those edges. The original bug - was that this Alpha channel wasn't coming through properly when using a Vray Mutisubtex. Which lead me here (otherwise I have to create a separate decal tree) but anyway, I'm liking the composite method if I can hide from non decal objects via offsetting the UVs.

@Eric - would you mind explaining the UVW xform offset a little?
I understand the concept but my UVW maps are not using Real World units, neither are my bitmaps and the UVW Xform appears to use real world units only.

Last edited by MisterS : 06 June 2013 at 10:09 PM.
 
Old 06 June 2013   #10
Just a hack to work around limits and use one mapping channel for multiple maps. If you have anything mapped in 0-1 space it will be applied anywhere that map is used. So if you want to use Map Channel 2 for all decals, which I have needed before, you have to map everything untiled outside of 0-1.

-Eric
__________________
"The Evil Monkey hiding in your closet."
 
Old 06 June 2013   #11
Originally Posted by MisterS: @Eric - would you mind explaining the UVW xform offset a little?
I understand the concept but my UVW maps are not using Real World units, neither are my bitmaps and the UVW Xform appears to use real world units only.
It should be 1.0 UV space for 1 default unit. So if you have default units is inches 1" = 1.0, if it is mm then 1mm = 1.0. It is an error in how the modifier displays the units.

-Eric
__________________
"The Evil Monkey hiding in your closet."
 
Old 06 June 2013   #12
Ok, so my system units are... inches. Display units are m. So my offset is 0.0254m!

I'll learn from that one. Still are few problems with visibility on some object - I'll have a play and se how I go.

Thanks.
 
Old 06 June 2013   #13
So the UVW xform method is working for me - need a clear head when setting it up though!

If anyone wants me to post some screen shots with an explanation then let me know.

Edit: I just wanted to add - thanks for the sound advice. I've been racking my brain for ages trying to figure out something decent. In the end I was able to keep my decal and dirt map trees and just use UVW xforms to control which objects use those bitmaps.

this meant I could delete duplicate shaders and an overcomplicated material editor. And it renders faster! sweet! You can maybe tell I was a little excited when it finally worked (been locked in a dark room for too long!)

EDIT#2

It's even easier to use the camera map Gemini variation, you simply just switch any projection that you like on of off for any object, no xform troubles either:

http://www.neilblevins.com/cg_educa..._projection.htm

Last edited by MisterS : 06 June 2013 at 08:01 AM.
 
Old 06 June 2013   #14
Glad you got it working! Thanks for the info on the Neil Blevins stuff, seems I was thinking of the wrong tutorial after all.

Now I have a question, about the UVW Xform. How is it that you are using multiple maps in a single map channel? I understand that you are using the UVW Xform modifier to move UV's outside or into the 1:1 space, but why exactly?
__________________
www.psvisuals.com - 3D Visualization and Content Creation
 
Old 06 June 2013   #15
Why:
  • Every map channel carries data overhead and adding unused map channels increases that overhead, whether used or not. A sphere with 200 segments and 2 smoothing iterations has 638,800 faces and 318,402 verts. Used map channels are ~11mb of data and unused are ~7.5mb of data, according to Map Channel Info Tool. Add a UVW Map with Channel 5 mapped and channels 2-4 are added as unused data and cost ~22.5mb.
  • Organization of content, base maps all on channel 1, dirt on channel 2, decals on channel 3, etc.
How:
  • You are using the UVW Xform as you would the unwrap editor, but in a more easily controlled method to offset the non-tiled mapping. Basically doing what Neil Blevins shows here, without the need of manually doing it in the Unwrap Editor.
-Eric
__________________
"The Evil Monkey hiding in your closet."
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:00 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.