[Closed] Render to texture with Alpha?
I can confirm that VRay + Refraction slot works the best way for my needs. Specifically – I need to bake a high-res roof covered with palm leaves (diffuse + alpha + normal-map + lighting) to one flat texture for low-res
roof covered with palm leavesroof covered with palm leaves
roof covered with palm leaves
No problem, glad It works for you!
Edit: You might have to resort to a cutout method for rendering the normal maps (assuming that recalculating them is necessary in most cases)
I see you already solved the problem so this is coming late.
Just out of curiosity, because I tried it with mental ray and I am trying to understand the problem you described, does this setup work on your end?
The only problem I see is that the final rendered texture does not have proper alpha (based on the images), but for people that don’t have VRay, there could be a workaround to create a separated image and use it as alpha.
I tried with lights, shadows, normal map, and everything renders correctly in Max 2014. The normal map (same as AO) uses the geometry and not the alpha from the materials.
(
delete objects
source = converttopoly (plane name:#source width:10 length:10 widthsegs:1 lengthsegs:1 wirecolor:green)
target = converttopoly (plane name:#target pos:[1,1,0.1] width:8 length:8 widthsegs:1 lengthsegs:1 wirecolor:orange)
t = converttopoly (plane name:#target pos:[-1,-1,0.2] width:8 length:8 widthsegs:1 lengthsegs:1)
polyop.setfacematid target #all 1
polyop.setfacematid t #all 2
polyop.attach target t
m0 = standard diffuse:black name:#source_mat
s0 = raytracematerial name:#shell_1
s1 = raytracematerial name:#shell_2
diff = bitmaptexture filename:@"c:\dust.jpg"
mask = bitmaptexture filename:@"c:\dust_mask.jpg"
s0.diffusemap = diff
s0.transparencymap = mask
s1.diffusemap = diff
s1.transparencymap = mask
meditmaterials[1] = m1 = multimaterial name:#target_mat numsubs:2 materiallist:#(s0, s1)
meditmaterials[2] = m0
source.mat = m0
target.mat = m1
)
This one should be ready for rendering. I think the only parameter that makes a difference in this example is the hitResolveMode, which by default is set to #closest.
(
resetmaxfile #noprompt
source = converttopoly (plane name:#source width:10 length:10 widthsegs:1 lengthsegs:1 wirecolor:green)
target = converttopoly (plane name:#target pos:[1,1,0.1] width:8 length:8 widthsegs:1 lengthsegs:1 wirecolor:orange)
t = converttopoly (plane name:#target pos:[-1,-1,0.2] width:8 length:8 widthsegs:1 lengthsegs:1)
polyop.setfacematid target #all 1
polyop.setfacematid t #all 2
polyop.attach target t
m0 = standard diffuse:black name:#source_mat
s0 = raytracematerial name:#shell_1
s1 = raytracematerial name:#shell_2
diff = bitmaptexture filename:@"c:\dust.jpg"
mask = bitmaptexture filename:@"c:\dust_mask.jpg"
s0.diffusemap = diff
s0.transparencymap = mask
s0.specular_level = 0
s0.glossiness = 0
s1.diffusemap = diff
s1.transparencymap = mask
s1.specular_level = 0
s1.glossiness = 0
meditmaterials[1] = m1 = multimaterial name:#target_mat numsubs:2 materiallist:#(s0, s1)
meditmaterials[2] = m0
source.mat = m0
target.mat = m1
/* RENDERING */
renderers.current = mental_ray_renderer()
/* PROJECTION */
select source
max modify mode
mdf = projection()
addmodifier source mdf
mdf.addobjectnode target
mdf.pushCage 0.25
/* RTT */
source.INodeBakeProperties.addBakeElement (diffusemap())
source.INodeBakeProperties.bakeEnabled = true
source.INodeBakeProjProperties.enabled = true
source.hitResolveMode = #furthest
source.warnRayMiss = false
)
i didn’t do any rendering for many years and probably forgot everything…
here is a simple setup for Standard and Raytrace materials. I expect to have at least the similar results.
after i render the scene using just the scanline render the Standard looks exactly how i expect it, but the Raytrace is completely off.
do you have any ideas how to match second and first one (get result for raytrace similar as for standard)?
delete objects
b0 = box name:#std_box width:20 length:20 height:20 pos:[-15,0,-10] wirecolor:green
s0 = sphere name:#std_sph radius:9 segs:32 pos:[-15,0,0] wirecolor:orange
meditmaterials[1] = m0 = b0.mat = standard()
m0.diffusemap = bitmaptexture filename:@"ELMLEAF.TGA"
m0.opacitymap = bitmaptexture filename:@"ELMLEAF.TGA"
b1 = box name:#ray_box width:20 length:20 height:20 pos:[15,0,-10] wirecolor:green
s1 = sphere name:#ray_sph radius:9 segs:32 pos:[15,0,0] wirecolor:orange
meditmaterials[2] = m1 = b1.mat = raytracematerial()
m1.diffusemap = bitmaptexture filename:@"ELMLEAF.TGA"
m1.transparencymap = bitmaptexture filename:@"ELMLEAF.TGA"
Me too. Just trying to work it out with you.
This seems to produce the same result (rendering). Didn’t try RTT.
(
delete objects
chkmat = standard diffusemap:(checker())
chkmat.diffusemap.coords.u_tiling = chkmat.diffusemap.coords.v_tiling = 10
b0 = box name:#std_box width:20 length:20 height:20 pos:[-15,0,-10] wirecolor:green
s0 = sphere name:#std_sph radius:9 segs:32 pos:[-15,0,0] wirecolor:orange material:chkmat
meditmaterials[1] = m0 = b0.mat = standard()
m0.diffusemap = bitmaptexture filename:@"C:\dust.tga"
m0.opacitymap = bitmaptexture filename:@"C:\dust.tga" monooutput:1
b1 = box name:#ray_box width:20 length:20 height:20 pos:[15,0,-10] wirecolor:green
s1 = sphere name:#ray_sph radius:9 segs:32 pos:[15,0,0] wirecolor:orange material:chkmat
meditmaterials[2] = m1 = b1.mat = raytracematerial()
m1.diffusemap = bitmaptexture filename:@"C:\dust.tga"
m1.transparencymap = bitmaptexture filename:@"C:\dust.tga" monooutput:1
m1.transparencymap.output.invert = true
m1.index_of_refraction = 1.0
m1.options___self_reflect_refract = false
m1.transparency_color_on = false
m1.enable_raytraced_reflections = false
m1.enable_raytraced_refractions = true
)
“dust.tga” is just a .TGA made with the previous dust.jpg and dust_mask.jpg
Super! It really looks the same… But the settings that make it don’t make sense sometimes. I appreciate your help very much, Jorge!