Opacity maps

VonDoomVonDoom Knee deep in the latency Join Date: 2009-10-08 Member: 68989Members, Reinforced - Shadow
<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>

Comments

  • twilitebluetwiliteblue bug stalker Join Date: 2003-02-04 Member: 13116Members, NS2 Playtester, Squad Five Blue
    marine.surface_shader does not take alpha channel into account.

    I think you need to modify the shader file and add something like:

    material.opacity = tex2D(opacityMap, input.texCoord).a
  • VonDoomVonDoom Knee deep in the latency Join Date: 2009-10-08 Member: 68989Members, Reinforced - Shadow
    Alright, comparing the two alien shaders, there only difference between them is a line near the bottom:

    <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?
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    edited January 2013
    Is there a specific reason you are trying to use the marine and alien shaders? I would suggest that Model_alpha.surface_shader is the one you are looking for.
  • VonDoomVonDoom Knee deep in the latency Join Date: 2009-10-08 Member: 68989Members, Reinforced - Shadow
    edited January 2013
    Ah, thanks a lot, that is probably the one i need!

    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
Sign In or Register to comment.