Jump to content
Sign in to follow this  
bravo 6

rvmat examples

Recommended Posts

Can someone post the .rvmat code of a desert bush, a desert ground and green grass, please?

I ask this because rvmat from ArmA1 seem to be different in the result.. more bright.

Share this post


Link to post
Share on other sites

Hey bud maybe we can help each other out. I think you can unPBO the Ca.pbo in ArmA2 and it will give you a whole bunch of bisurfs and rvmat codes.

The problem I am having in understanding how to implement rvmat into an addon? or how to add a material to a face in O2. I need help with understanding how do I make rvmat files.... do I add the information into wordpad and then save the file as something.rvmat? or do I need to use the MAT.dll or MatEditor.exe? Will arma2 beable to read that rvmat made out of a wordpad? If you understand rvmat can you help me out in understanding it. Thanks.

Edited by Meatball0311

Share this post


Link to post
Share on other sites

Binarized rvmats can't be opened, AFAIK.

Rvmats are just text so anything that makes a simple text file can make an rvmat. To apply an rmat to some faces, select the faces you want to apply them to, then press e. In the face properties window, find the material field at the bottom right of the dialogue. Add the rvmat you want by browsing to its location and selecting it.

I'm pretty sure this information is available elsewhere in the forum. If you want to learn the tools and become and addon maker, get used to using the search function in the forums.

Share this post


Link to post
Share on other sites
Binarized rvmats can't be opened, AFAIK.

Rvmats are just text so anything that makes a simple text file can make an rvmat. To apply an rmat to some faces, select the faces you want to apply them to, then press e. In the face properties window, find the material field at the bottom right of the dialogue. Add the rvmat you want by browsing to its location and selecting it.

I'm pretty sure this information is available elsewhere in the forum. If you want to learn the tools and become and addon maker, get used to using the search function in the forums.

Thanks for your input... to let you know I have done some extensive searching and they all really do not give the specifics that I am looking for. The input you gave me was a detailed step by step that makes it clearer to the reader (or at least myself). Thanks

You can however open bisurfs with Eliteness

Edited by Meatball0311

Share this post


Link to post
Share on other sites

Binarized rvmats or configs can be "extracted" into .cpp and then simple rename into .rvmat

unRap tool by kegetys > Try it download

Share this post


Link to post
Share on other sites
Thanks for your input... to let you know I have done some extensive searching and they all really do not give the specifics that I am looking for. The input you gave me was a detailed step by step that makes it clearer to the reader (or at least myself). Thanks

You can however open bisurfs with Eliteness

No problem.

If this info isn't clearly stated elsewhere, I hope future searches done by others will come to this thread, then :p

Share this post


Link to post
Share on other sites
Binarized rvmats can't be opened, AFAIK.

Sorry, you are wrong.

Binarized rvmats can be opened and saved after that with eliteness (directly as rvmat, not first as cpp like RH sadi) and then edited further

Share this post


Link to post
Share on other sites

Well.. codes were asked, but no one who read or replied has posted any.

Anyway, I'll post 2 examples of ArmA2 original clutter rvmat's and I would like to ask why some rvmat codes use addresses to a paa file and others do not.

c_grassbunchdry.rvmat

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

class TexGen0 {
uvSource = "tex";

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

class Stage0 {
texture = "ca\plants2\clutter\data\c_grassbunchdry_ca.paa";
texGen = 0;
};

c_grassbunch.rvmat

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

Now, does anyone know why some clutter use an address to a .paa file and others do not?

Share this post


Link to post
Share on other sites
Sorry, you are wrong.

Binarized rvmats can be opened and saved after that with eliteness (directly as rvmat, not first as cpp like RH sadi) and then edited further

I think the EULA says something about reverse engineering... I'm not quite certain :p

Share this post


Link to post
Share on other sites
I think the EULA says something about reverse engineering... I'm not quite certain :p

:rolleyes: that would go for config.bin files as well, wouldn't it?

Share this post


Link to post
Share on other sites
:rolleyes: that would go for config.bin files as well, wouldn't it?

Yes. I create new ones based on what BI has already revealed and my own artistic sense, not by reverse engineering unreleased unbinned material.

Share this post


Link to post
Share on other sites
Yes. I create new ones based on what BI has already revealed and my own artistic sense, not by reverse engineering unreleased unbinned material.

Why don't i believe that you have never unbinned a config file? ;)

Anyways, you can use the rvmat just as example, and rewrite everything just to be on the safe side..

Share this post


Link to post
Share on other sites

@bravo6... With the 2 examples that you posted...

You should note that the first uses "Grass" PS & VS and that the .paa mentioned is in Stage Zero.

In the majority of .rvmat's stage zero is usually 'null' or not used. It's principal role is as a 'macro' texture in that IF it is specified AND IF there is a primary diffuse texture also mapped to the given face that this .rvmat is mapped too then the stage zero texture will be blended with the primary diffuse texture. There were a couple of good examples of this being used in A1 and A2 but I can't remebered them of the top of my head.

Stage zero is used alot more however in the newer "Super" and "Multi" shaders.

This first .rvmat is used by the 'c_deadGrassBunch.p3d' and you could assume that this particular .p3d's Res LoD faces have NO primary diffuse texture applied.

If you take these 2 assumptions to be true and correct then stage zero acts as a primary diffuse texture simply because it's in stage zero's 'slot' AND it has nothing to blend with from the model. Get it?

One can assume that both "Basic" and "Grass" vertex & pixel shaders require very little in the way of "input" parameters. That is essentially they only require some diffuse texture input along with the model's actual topology.

The 2nd .rvmat you listed is used in 'c_grassBunch.p3d' and there is no stage zero texture mentioned most assuredly because there is a primary diffuse texture associated with the faces of the Res LoDs in the model.

You say you were trying to use an A1.rvmat for presumably your own clutter and it was too 'bright'. Perhaps if you posted that .rvmat someone might be able to give you some hints as to toning down it's 'brightness'.

Cheers.

PS. Since the release of A1 BIS have provided 2 commandline tools in the developement suite to convert rapified .bin, .rvmat & bisurf files to and from there textual equivalent. While at the same time they have never provided the same sort of tool to extract .pbo's. Well, at least for this product range anyway.

Edited by Synide

Share this post


Link to post
Share on other sites

Synide, Thank you for your explanation, it was very clear as usual.

Here is an example of an ArmA1 rvmat i used to have. At the time i was working on a terrain and testing rvmat codes I understood quite well the difference between values, but now with ArmA2, they are very bright compared to ArmA1.

"OLD ARMA1 rvmat code"

BC_clutter_desertbush_escuro.rvmat

ambient[] = {0.5, 0.5, 0.5, 6};
diffuse[] = {0.5, 0.5, 0.5, 1.0};
forcedDiffuse[] = {0.0, 0.0, 0.0, 1.0};
emmisive[] = {0.0, 0.0, 0.0, 1.0};
specular[] = {0.0, 0.0, 0.0, 1.0};
specularPower = 1.0;

mainLight = "Sun";
fogMode = "Fog";

PixelShaderID = "Grass";
VertexShaderID = "Basic";

renderFlags[] = {"AddBlend", "AlphaTest32"};

I am already using the new ArmA2 rvmat codes, but they are still too bright, maybe i need to edit the old paa images and make them less bright.

EDIT: to let you know what rvmat im using at the moment i post here.

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

Edited by bravo 6

Share this post


Link to post
Share on other sites

I'll have to have a think about your settings tomorrow evening. Oh also, I just noted another reason 'c_grassbunchdry.rvmat' has a texture reference specified in 'Stage Zero'. And, that's because whomever made the model probably UV mapped the faces to the upper half of the V-axis in UV space.

And, was taking advantage of being able to apply a UV transform to the texture within the .rvmat.

The up[]={0.0,2.0,0.0} has the effect of forcing twice as much of the vertically mapped texels into the mapped face.

Share this post


Link to post
Share on other sites
Why don't i believe that you have never unbinned a config file? ;)

Because it's common practice and you can't believe someone can get by without it.

The truth is, I don't get by with out. I have never really had much need to write a config file. I don't make stand alone addons. When I've needed to do config work, I find that OFPEC, the wiki, and community members tend to be very helpful. RVMATs are much simpler than configs, however. Reverse engineering them is not required at all because you have a gui editor with instantaneous visual feedback of changes in buldozer. All that's needed is a cursory understanding of the different passes and slider values.

Edited by Max Power

Share this post


Link to post
Share on other sites

@Bravo6... Sorry just got home... had a quick squizzy at your current .rvmat... it looks fine. As you say, you may find your diffuse texture is 'too bright'. Do you have photoshop? If so, open the original .tga from the A1.rvmat in PS and have a look at the 'Histogram'. What's the 'mean' value?

Then open your .tga diffuse texture and look at the 'mean' value. Is there a significant difference?

If you don't have PS you could send your texture to me and I'll do a quick (and probably nasty) analysis to see if anything jumps out at me.

With the first set of .rvmat's you posted the 'c_grassbunchdry.rvmat' in turn points to 'ca\plants2\clutter\data\c_grassbunchdry_ca' which as you've probably noted is a rather 'bright' looking texture anyway. I take it your natural look 'n feel for your overall environment is in a similar vain presumably.

Again, perhaps compare the 'mean' from the Histogram in PS of both this 'c_grassbunchdry_ca' (which is about 150) and your own.

That is say if yours was about 170. With your image loaded in PS you'd hit CTRL-L or Image>Adjustments>Levels select 'Lightness' from the dropdown combobox and adjust the righthand slider for Output Levels down till your mean on the Histogram was about 150.

Then use the same sort of values from 'c_grassbunchdry.rvmat' in your .rvmat.

In saying that though I'm not that ofay with Photoshop so that maybe bad advice.

I don't think I'll be much help to you from here on though.

Perhaps someone else will stop self-pontificating long enough to grace you with a reply to your post. I'm sure an 'arteeest' has alot of knowledge of PS or texturing in general.

Share this post


Link to post
Share on other sites
Perhaps someone else will stop self-pontificating long enough to grace you with a reply to your post. I'm sure an 'arteeest' has alot of knowledge of PS or texturing in general.

That's no way to ask for help, Synide. If you need my help, simply prostrate yourself before me with your hands clasped and wail...

Share this post


Link to post
Share on other sites

Synide, thank you again for your attention and reply.

I never thought about the average colors, to compare the average values as you mentioned. Its a very good tip and things may work properly finally.

I don't exactly know where to look on Photoshop CS3 for the 'mean' as you said, anyway I opened the .paa file with textview and the average (AVG) color is the following one ( 125,140,85 ).

Don't know is this AVG value helps for the analysis.

Again, thanks for your help. Very appreciated. :)

Edited by bravo 6
typo

Share this post


Link to post
Share on other sites

In PS CS3... same as me... Window>Histogram from the main menu while you have your textures open. It'll show you a distribution graph and give you some statistical values at the bottom. I was just curious what the mean was for your texture compared to the mean of 150 for that 'c_grassbunchdry_ca'. Oh, my bad, before when I said the 'Lightness Levels' I forgot to say you'd have to turn your image into a 'Lab Color' under Image>Mode.

Why was I curious? Because, one of the things you want to keep in mind is that when designing islands, environments etc. and generally the objects that will go in them is you want to try and restrict yourself to having textures that are not too dissimilar. Or, have 'zones' around your map where the general textures fall within the same sort of colour gamut ranges. It's a very subjective thing of course. Then once you have areas of your map and the objects within the same sort of lightness levels you tweak the look and feel through altering the .rvmat values.

For example you may have made the decision that the north part of your map might be a quite dry, desolate looking region and through your own testing decided that in the main your textures for the environment might want to fall with a mean range of say 125 - 175 for lightness levels. And, the south in the vacinity of 50 - 100. These are wild example figures, btw.

But, do you get what I mean?

Edited by Synide

Share this post


Link to post
Share on other sites

Ok, now i know what you meant with the PS mean option.

Normal grass, in PS, have mean 114,16.

Dry grass, in PS, have mean 171,47.

I think the major issue is in the rvmat settings. With some tweaks and time they will end up fine, its just a matter or time to import/binarize etc..

Thank you for your feedback/replies and help!

Much appreciated.

Share this post


Link to post
Share on other sites

I think that the problem lies in your specular settings. I think your specular power might be too low.

Notice the background in these examples:

000.jpg013.jpg025.jpg050.jpg100.jpg

These show specular power in the smdi map being at 0%, 25%, 50%, and 100%, all else being equal. The background appears to get lighter as the specular power increases. This difference in background colour is the result of the virtual aperture opening because the object is becoming less bright. At low numbers, the hot spots on the object are blasting out the camera. This, of course, is a one object scene. If you have more objects contributing to the scene, this object would just appear quite bright as the specular power decreases. If your object is too bright, try reducing the specular amount or increasing the specular power. If increasing the specular power works well, you might think about rebalancing your smdi map's green channel.

Share this post


Link to post
Share on other sites

He's not using a spec map... at least he hasn't mentioned that he's using one. And, quite frankly, with this model it would not be required. To say the least that the shader used doesn't require a specific spec map texture stage anyhoo.

I guess the plus side is your actually posting 'on topic'.

Share this post


Link to post
Share on other sites
He's not using a spec map... at least he hasn't mentioned that he's using one. And, quite frankly, with this model it would not be required. To say the least that the shader used doesn't require a specific spec map texture stage anyhoo.

I guess the plus side is your actually posting 'on topic'.

Unfortunately for your moderating career, Synide, all of my posts were on topic or replying to specific comments or questions asked of me- or should I say, much more on topic than your flamebait. Thanks for coming out, though.

If he's not using any glossiness properties at all, then he can discard my advice. Sadly, your advice didn't really fix his problem so someone needed to step in with new ideas. I'm sorry if that makes you feel uncomfortable. It's okay though because we're all a community and we're here for you.

:icon_hug:

Share this post


Link to post
Share on other sites

I think I'm not using a smdi map. Its just the simple rvmat for the clutter plants and the ground textures.

Maybe i need to change a little bit the original Sat_lco.png and the data *_co.paa.

I had to create this thread because for me (my computer) the hole procedure takes a lot of time, to input the mask and sat, and to binarize.. Every test i do to see the changes are really boring for me and atm I have no free time to do it.

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  

×