Opacity maps
VonDoom
Knee deep in the latency Join Date: 2009-10-08 Member: 68989Members, Reinforced - Shadow
in Modding
<div class="IPBDescription">how to make the work</div>As the title says, I should have done this right, but the overlaying texture is still not see-through. I have also made an alpha channel with the pattern i need in the psd file, but without success. :(
I looked at the hologram material files in the ns2 folder as a reference.
Im making a giant guitar amplifier, and I need the mesh in the front to have an alpha. I can create a mesh in polys, but that wouldn't be very res efficient!
<b>shader = "models/marine/marine.surface_shader"
albedoMap = "models/props/mega-amp/mega-amp_mesh_diffuse.dds"
opacityMap = "models/props/mega-amp/mega-amp_mesh_alpha.dds"
specularMap = "materials/dev/black.dds"
normalMap = "materials/dev/dev_normal.dds"
surface = "metal"</b>
I looked at the hologram material files in the ns2 folder as a reference.
Im making a giant guitar amplifier, and I need the mesh in the front to have an alpha. I can create a mesh in polys, but that wouldn't be very res efficient!
<b>shader = "models/marine/marine.surface_shader"
albedoMap = "models/props/mega-amp/mega-amp_mesh_diffuse.dds"
opacityMap = "models/props/mega-amp/mega-amp_mesh_alpha.dds"
specularMap = "materials/dev/black.dds"
normalMap = "materials/dev/dev_normal.dds"
surface = "metal"</b>
Comments
I think you need to modify the shader file and add something like:
material.opacity = tex2D(opacityMap, input.texCoord).a
<b>alien.surface_shader</b>
<i>// Opacity
material.opacity = opacity + f - 0.5;
material.emissive = tex2D(emissiveMap, input.texCoord).rgb * f * glowIntensity;</i>
<b>alien_alpha.surface_shader</b>
<i>// Opacity
material.opacity = (opacity + f - 0.5) * tex2D(opacityMap, input.texCoord).rgb;
material.emissive = tex2D(emissiveMap, input.texCoord).rgb * f * glowIntensity;</i>
But the marine surface shader looks like this:
<i>//Â Opacity
material.opacity = opacity + f - 0.5;
if (material.opacity < 0.5) {
material.emissive = 0;</i>
I dont know where to insert the "material.opacity = tex2D(opacityMap, input.texCoord).a" line in the marine shader :/ Or should I just try to use the alien_alpha shader instead?
I just needed one that supported an alpha map, I didnt find it to begin with so i thought i had to modify the default marine or alien shader :o