Jump to content
Sign in to follow this  
shinkicker

alpha channel not showing when using hiddenselections

Recommended Posts

I have set up two classes with one model.

The second class inherits from the first, but with a hiddenselection pointed to a diffuse that contains an alpha channel (transparent).

The p3d has a namedselection called 'camo' in each of my lods.

I want to create a ghost model in effect.

When the diffuse with the alpha channel is applied using hiddenselections, it loses the transparency.

When I apply the diffuse (_ca.paa) with the alpha channel directly to the object, I can see the transparency with no issues. When I apply the same _ca.paa alpha based diffuse via hiddenselections, it ignore the alpha channel (thereby out-ruling an issue with the alpha channel itself)

class CfgModels
{
class Default;
class box: Default 
{
sections[]={"camo"};
sectionsInherit = "";	
};
class ghost: box{};
};

class CfgVehicles 
{
class ThingX;
class box: ThingX {
	model = "objtest\box.p3d";
	mapSize = 1.50;
	vehicleClass = "objtest";
	scope = 2;
	displayName ="Normal Box"; 
	icon = "iconObject_circle";
};
class ghost: box {
	vehicleClass = "objtest";
	model = "objtest\ghost.p3d";
	displayName ="Ghost Box";
	hiddenSelections[] = {"camo"};
	hiddenSelectionsTextures[] = {"objtest\texture\mtl_trans_ca.paa"};
};
};

The top image is the mtl_trans_ca.paa set as a hiddenselection to the class 'ghost' (shown to left). The lower image is the mtl_trans_ca.paa applied directly as the main diffuse.

http://i.imgur.com/u4xlCb5.png (490 kB)

Edited by shinkicker

Share this post


Link to post
Share on other sites

Hi, there's no problem. When you plan to use _CA texture as hiddenSelectionsTexture, the model have to prepared for that.

On model has to be alpha channel texture eg. #(argb,8,8,3)color(0,0,0,0,CA) (invisible), then engine knows, that this object contains alpha. So try to add that procedural colour into Ghost.p3d and then try to apply any _CA hiddenSelectionsTexture.

Share this post


Link to post
Share on other sites
Hi, there's no problem. When you plan to use _CA texture as hiddenSelectionsTexture, the model have to prepared for that.

On model has to be alpha channel texture eg. #(argb,8,8,3)color(0,0,0,0,CA) (invisible), then engine knows, that this object contains alpha. So try to add that procedural colour into Ghost.p3d and then try to apply any _CA hiddenSelectionsTexture.

Sorry for late reply and thanks for answering.

So by using this procedure I will need two different P3D's? If so that defeats the purpose somewhat as I was doing this so that I only needed one p3d. If I have two P3D's I may as well not bother with a hiddenselection and just apply the regular diffuse to box.p3d and the alpha diffuse to ghost.p3d.

Here is my desired set up:

 class ghost: box {
       vehicleClass = "objtest";
       displayName ="Ghost Box";
       hiddenSelections[] = {"camo"};
       hiddenSelectionsTextures[] = {"objtest\texture\mtl_trans_ca.paa"};
   };
};  

* no model set (just inherit and then render the alpha diffuse with camo)

This way I don't need two models (twice the disc space), just to render a transparent texture.

Edited by shinkicker

Share this post


Link to post
Share on other sites

do it like redstone said and make your main texture a _ca as well. Just put a completely black alpha channel in it. thats what i would try

Share this post


Link to post
Share on other sites
do it like redstone said and make your main texture a _ca as well. Just put a completely black alpha channel in it. thats what i would try

The alpha is fine, as you can see it works when applied to an object.

The problem is he does not explain how to add '#(argb,8,8,3)color(0,0,0,0,CA) (invisible)' to the mesh? How would I do that without overwriting the diffuse?

EDIT: ok you can use mass renaming and enter it as a mask, still does not work though.

Edited by shinkicker

Share this post


Link to post
Share on other sites
The problem is he does not explain how to add '#(argb,8,8,3)color(0,0,0,0,CA) (invisible)' to the mesh? How would I do that without overwriting the diffuse?

You do overwrite it. As i understand it, it's basically like for variables in code. You Need to initialize them first before you can use them in the equation. With that line you tell the engine that this part is with an Alpha.

Then you use hiddenSelectionsTextures in your config to define the real texture path.

and it should be

#(argb,8,8,3)color(0,0,0,0,CA)

the invisible is just a note from redstone ;)

Share this post


Link to post
Share on other sites

Sorry I am late. Yes, just use that procedural colour instead of any texture on model.

Or use any _ca texture.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×