Jump to content
Sign in to follow this  
Robster

Transparency in trees/bushes models

Recommended Posts

Hello everyone,

How can I get rid of these borders? I'm using a *_ca.paa file and I have changed size of alpha mask with no success...

30ua5qd.jpg

EDIT: Sorry, I did post in A1 forums befor by mistake... I guess that A2 has introduced some improvements regarding precisely trees/bushes models

Share this post


Link to post
Share on other sites

what is the rvmat you are using , this also affect it , look on BIS tree and you will find it :)

also sometimes Bulldozer may not reflect whats in game of course.

If you really struggle MikeBart is the man or Berghoff the tree man , look them up i think Mikebart recently posted here about tree ;)

Share this post


Link to post
Share on other sites

never judge transparency in Buldozer, always in full game.

Share this post


Link to post
Share on other sites

This still looks like sh*t :)

90r3w3.jpg

And those files inside plants2 folder are truly scary... mc, non and stuff... anyways, I can't read RVMATs as plain text since they are binarized...

S.O.S.

EDIT: I am not using any RVMAT... is there any I should be using for these purposes? probably, but which one? I do not know how to do an *_mc.paa or an *_non.paa file ? Will I have to buy LINDA ????

Edited by Robster

Share this post


Link to post
Share on other sites

RVMATs files can be unbined using eliteness.

Have a look over BIS trees.

You don't have to buy LINDA

I would say the issue is still caused by a very tight Alpha chnl

Share this post


Link to post
Share on other sites

You dont need to Unbinarise to test it :)

simply point in o2 to it and it will be ok to see if its good , not sure if improvements are made between A2 and OA but iwould try oa or Plants_e first , maybe something like b_amygdalusn1s_ep1_1.rvmat and dont forget also Shadow have rvmat too as you will see in there.

I also rememebr there is a free example of tree from BIS on there website somewhere google will find it probably

Share this post


Link to post
Share on other sites

hey Robster, theres a few different ways of doing it.

Nozwrite

If you want a blended alpha like the tussock in mb_veg, you need to sort alpha in O2 (Faces/Sort Alpha), and use the "nozwrite" render flag in the .rvmat, that should fix those edges. Its not really meant for vegetation though, you get a few errors sometimes and they draw in front of fog, but you can get away with it on a smaller terrain, cheep tricks but with costs.

mainLight="None";
fogMode="Alpha";
ambient[]={1.0,1.0,1.0,1.000000};
diffuse[] = {1.0,1.0,1.0,1.0};
forcedDiffuse[] = {0.0,0.0,0.0,1.0};
emmisive[] = {0.0,0.0,0.0,1.0};
specular[] = {0.0000,0.0000,0.0000,1.0};
specularPower = 1.0;
renderFlags[]= {"NoZWrite"};
PixelShaderID="Normal";
VertexShaderID="Basic";

treeAdv

I dont think you have to use an _mca or a second UVW channel for treeAdv, you should be able to give that stage a colour value instead of a bitmap and i think the shader would still work.

ambient[]={0.5,0.5,0.5,1};
diffuse[]={0.38039216,0.28235295,0.62352943,1};
forcedDiffuse[]={1,1,1,1};
emmisive[]={0,0,0,1};
specular[]={0.1,0.1,0.1,1};
specularPower=126;
PixelShaderID="TreeAdv";
VertexShaderID="TreeAdv";
class Stage1
{
texture="mikebart\mb_veg\mb_trees\data\mb_t_ulmus_foliage_NO.tga";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage2
{
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,MCA)";	     //replaced "mikebart\mb_veg\mb_trees\data\mb_t_ulmus_forest_MCA.tga" with a colour value, adjust to suit
uvSource="tex";                                                     //changed "tex1" to "tex" 
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};

the ambient value in treeAdv controls how much the tree shades overall, its hard to explain but to get an understanding of that, see what happens when you decrease ambient to 0.1,0.1,0.1,1.0 and then increase it to something like 4.0,4.0,4.0,1.0

but without the lightmap (_MCA bitmap) on the second UV, you wont have any baked in ambient occlusion or colour variation.

_can stands for colour alpha noise, If you have a look at the _can textures used for foliage in A2OA, you'l notice the noise on the white parts of the alpha channel, this is used in game when the alpha polygon becomes adjacent to the players view, that polygon fades kind of noisely, im sure you know what I mean from looking at trees in game.

noiseforcanalpha.th.jpg

above is a 2048 bitmap of the right sort of noise you need for the _can texture, just multiply this over your alpha channel.

_mca is basically a lightmap, not sure what it stands for but thats pretty much what it does, the image below shows an _mca mapped to a second UVW channel, unlike the _ca or _can's every UV is mapped to be unique (no overlap of UV's) the _mca below also shows details from the _can from the first UVW channel, hopefully you can get a better idea of whats going on from this:

treeadv.th.jpg

Grass

If you're intending to use that plant just for clutter, just use the grass shader,

ambient[] = {0.3,0.3,0.3,1.0};
diffuse[] = {0.1,0.1,0.1,1.0};
forcedDiffuse[] = {0.0,0.0,0.0,1.0};
emmisive[] = {0.0,0.0,0.0,1.0};
specular[] = {0.0000,0.0000,0.0000,1.0};
specularPower = 1.0;
PixelShaderID="Grass";
VertexShaderID="Basic";
mainLight="Sun";
fogMode="Fog";
renderFlags[] = {"AlphaTest32"};

Edited by mikebart

Share this post


Link to post
Share on other sites

Many thanks for your help, Mr. Bartlett!

I will certainly put all this into practice to see how far can I get ...

I'll keep posting here any further advances on the matter, to gather more info about making trees/bushes models...

Edited by Robster
spelling

Share this post


Link to post
Share on other sites

Good night mates!

I made some simple tests and this is what I've gotten so far...

Here we have that annoying "invisible effect" border in a maize custom model originally made by DMC ...

33lgw2u.jpg

Here we made a simple change in the rvmat on the same model:

2l8dtti.jpg

As you may see those ugly boundaries are gone... this is not related to model shape or an oversized alpha mask... this is related to rvmat definition...

ok, here is the trick... any comments are welcome, cheers!

ambient[] = {0.5, 0.5, 0.5, 1.0};
diffuse[] = {0.5, 0.5, 0.5, 1.0};
forcedDiffuse[] = {0.5, 0.5, 0.5, 0.5};
emmisive[] = {0.0, 0.0, 0.0, 1.0};
specular[] = {0.0, 0.0, 0.0, 1.0};
specularPower = 1.0;
PixelShaderID = [color="#FF0000"]"NormalMapThrough"[/color];
VertexShaderID = [color="#FF0000"]"NormalMapSpecularThroughNoFade"[/color];

[color="#0000FF"]class Stage1[/color] {
texture = [color="#FF0000"]"ca\plants2\tree\blank_non.paa"[/color]; [color="#008000"]// this file comes from arma2, so you have it already![/color]
uvSource = "tex";

class uvTransform {
	aside[] = {1.0, 0.0, 0.0};
	up[] = {0.0, 1.0, 0.0};
	dir[] = {0.0, 0.0, 0.0};
	pos[] = {0.0, 0.0, 0.0};
};
};

[color="#0000FF"]class Stage2 [/color]{
texture = "#(ai,32,32,1)[color="#FF0000"]treeCrown[/color](0.3)";
uvSource = "none";
};

[color="#0000FF"]class Stage3[/color] {
texture = "#(ai,32,32,1)[color="#FF0000"]treeCrownAmb[/color](0.3)";
uvSource = "none";
};

EDIT: I know picture quality is not the best but I do not want another infraction for images > 100kb :p

Edited by Robster

Share this post


Link to post
Share on other sites

hey Robster, try this out instead. Because you're using the NoFade shader you dont really need to use the ".non" bitmap for the normalmap, and should get away with just using the flat colour ".no"

try using the TreeAdv shaders, they should give you a cleaner image (not so degraded around the edges) also I dont think the old NormalMapThrough shaders work with "AtoC"

I didnt really test this myself, so i hope it works ;)

ambient[] = {0.5, 0.5, 0.5, 1.0};
diffuse[] = {0.5, 0.5, 0.5, 1.0};
forcedDiffuse[] = {0.5, 0.5, 0.5, 0.5};
emmisive[] = {0.0, 0.0, 0.0, 1.0};
specular[] = {0.045,0.045,0.045,0.2};
specularPower = 300;
PixelShaderID = [color="#FF0000"]"TreeAdv"[/color];
VertexShaderID = [color="#FF0000"]"TreeNoFade"[/color];

[color="#0000FF"]class Stage1[/color] {
texture = [color="#FF0000"]"#(argb,8,8,3)color(0.5,0.5,1.0,1.0,NO)"[/color]

class uvTransform {
	aside[] = {1.0, 0.0, 0.0};
	up[] = {0.0, 1.0, 0.0};
	dir[] = {0.0, 0.0, 0.0};
	pos[] = {0.0, 0.0, 0.0};
};
};
class Stage2
{
 texture = [color="#FF0000"]"#(argb,8,8,3)color(0.25,0.25,0.25,0.6,MCA)"[/color];
uvSource = "tex";
class uvTransform
{
 aside[] = {1,0,0};
 up[] = {0,1,0};
 dir[] = {0,0,0};
 pos[] = {0,0,0};
};
};
//};

btw; do you know what the treecrown stages do?, I remember seeing them in Arma 1 trees but never really figured them out

Share this post


Link to post
Share on other sites

erm... that didn't work as expected:

343njpk.jpg

I do not know what's that "treeCrown" thing... just reading a bit -and sometimes there's not much for reading on wiki- but most of the time learning by doing...

I guess "AtoC" is used, but this picture does not tells too much about this dry bush experiment

EDIT: Your eucaliptus are awesome... certainly it would be great to get them on armaverse ;) we have'em -imported- here in Chile also and anybody who's paid a visit to an eucaliptus forest will never forget how it smells mmm in fact many of my child forests memories are related to these trees which are very common in our central area coastal line

Edited by Robster

Share this post


Link to post
Share on other sites

oh ok, the ambient and the MCA were way too dark, I should have tested it out.

Try this out, worked pretty well for the mb_tussock model;

ambient[] = {1.0, 1.0, 1.0, 1.0};  [color="#FF0000"]//increased ambient to 1.0 [/color]
diffuse[] = {0.5, 0.5, 0.5, 1.0};
forcedDiffuse[] = {0.5, 0.5, 0.5, 0.5};
emmisive[] = {0.0, 0.0, 0.0, 1.0};
specular[] = {0.045,0.045,0.045,0.2};
specularPower = 300;
PixelShaderID = "TreeAdv";
VertexShaderID = "TreeNoFade";

class Stage1 {
texture = "#(argb,8,8,3)color(0.5,0.5,1.0,1.0,NO)"

class uvTransform {
	aside[] = {1.0, 0.0, 0.0};
	up[] = {0.0, 1.0, 0.0};
	dir[] = {0.0, 0.0, 0.0};
	pos[] = {0.0, 0.0, 0.0};
};
};
class Stage2
{
 texture = "#(argb,8,8,3)color(0.75,0.75,0.75,0.6,MCA)"; [color="#FF0000"]//increased the MCA to 0.75, before it was too dark, think of it as another ambient control[/color]
uvSource = "tex";
class uvTransform
{
 aside[] = {1,0,0};
 up[] = {0,1,0};
 dir[] = {0,0,0};
 pos[] = {0,0,0};
};
};
//};

yeah they're pretty cool trees, im attempting to make the messmate eucalyptus

you can see why they're called messmate by the picture below, "because they make a mess mate"

oororoo011.jpg

I like the dry brush, it looks like you could put alot of it down and still get good performance, the treeAdv shader should help it shade nicely and corrospond with a light source.

edit: I just noticed that, that .rvmat receives no shadow, you need to use "TreeAdv" in the vertex shader and use a .can for the diffusemap, just multiply the noisey image i posted a few weeks back onto the alpha channel of your .ca and save it as .can.

do you use photoshop?

Edited by mikebart

Share this post


Link to post
Share on other sites

ok... I will test rvmat asap and report

Those dry bushes are nothing but a bunch of planes... 48 polys on first ResLOD... so I can plant them all over the map and performance will be fine still... I tried to do as you teach, but I play on modo -3dsmax is a bit frightening to me- and I do not know how to make a proper render... in fact I'm quite ignorant using this stuff... so i just took pics from front, back, right, left and top views and then arrange these on PS + alpha mask... pretty amateur :p

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  

×