Jump to content

Photo
- - - - -

Transparency in trees/bushes models


  • Please log in to reply
12 replies to this topic

#1 Robster

Robster

    Gunnery Sergeant

  • Members
  • 454 posts

Posted 05 April 2012 - 10:18 PM

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...

Posted Image

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

Posted Image

#2 Sealife

Sealife

    Banned

  • Banned
  • 1362 posts

Posted 05 April 2012 - 11:43 PM

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 ;)

#3 IceBreakr

IceBreakr

    Captain

  • Members
  • 6189 posts

Posted 05 April 2012 - 11:44 PM

never judge transparency in Buldozer, always in full game.
IceBreakr, C/O [SBP] - Slovenian Black Panthers (www.vojak.si)

OUT NOW for A3: Isla Duala 3.3 | Island Panthera v3.1
WIP: Isla Abramia, Lingor, Tonal Legend, Isla Balkania, Keystone, Jade Groove 3, Ibis World, Rowalla.

Posted Image

#4 Robster

Robster

    Gunnery Sergeant

  • Members
  • 454 posts

Posted 06 April 2012 - 01:37 AM

This still looks like sh*t :)

Posted Image

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, 06 April 2012 - 01:43 AM.

Posted Image

Posted Image

#5 PuFu

PuFu

    Poly Bully

  • Members
  • 7161 posts

Posted 06 April 2012 - 05:51 AM

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

Posted Image


#6 Sealife

Sealife

    Banned

  • Banned
  • 1362 posts

Posted 06 April 2012 - 03:01 PM

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

#7 mikebart

mikebart

    Gunnery Sergeant

  • Members
  • 437 posts

Posted 18 April 2012 - 07:46 AM

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.
Posted Image
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:
Posted Image

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, 18 April 2012 - 08:46 AM.


#8 Robster

Robster

    Gunnery Sergeant

  • Members
  • 454 posts

Posted 18 April 2012 - 03:09 PM

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, 31 May 2012 - 02:36 AM.
spelling

Posted Image

Posted Image

#9 Robster

Robster

    Gunnery Sergeant

  • Members
  • 454 posts

Posted 31 May 2012 - 01:58 AM

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 ...

Posted Image

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

Posted Image

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, 31 May 2012 - 02:09 AM.

Posted Image

Posted Image

#10 mikebart

mikebart

    Gunnery Sergeant

  • Members
  • 437 posts

Posted 03 June 2012 - 10:54 AM

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

#11 Robster

Robster

    Gunnery Sergeant

  • Members
  • 454 posts

Posted 03 June 2012 - 05:44 PM

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

Posted Image

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, 03 June 2012 - 07:12 PM.

Posted Image

Posted Image

#12 mikebart

mikebart

    Gunnery Sergeant

  • Members
  • 437 posts

Posted 04 June 2012 - 11:04 AM

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"
Posted Image

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, 04 June 2012 - 11:44 AM.


#13 Robster

Robster

    Gunnery Sergeant

  • Members
  • 454 posts

Posted 04 June 2012 - 04:54 PM

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
Posted Image

Posted Image