Jump to content
Sign in to follow this  
mikebart

OA tree shaders

Recommended Posts

hi, im attempting to use the new tree shaders for OA, but not having much luck. I have the TreeAdv and TreeAdvTrunk shaders working correctly in bulldozer (using arma2ao.exe) and they look great, but when I binarize them to run them in the game i get these errors:

<model = "p:\mikebart\mb_veg\mb_trees_adv\mb_t_ulmus_large.p3d">
mikebart\mb_veg\mb_trees_adv\data\mb_t_ulmus_large_trunk_adv.rvmat.pixelShaderID: Unknown enum value TreeAdvTrunk
mikebart\mb_veg\mb_trees_adv\data\mb_t_ulmus_large_trunk_adv.rvmat.vertexShaderID: Unknown enum value TreeAdvTrunk
mikebart\mb_veg\mb_trees_adv\data\mb_t_ulmus_large_1_adv.rvmat.pixelShaderID: Unknown enum value TreeAdv
mikebart\mb_veg\mb_trees_adv\data\mb_t_ulmus_large_1_adv.rvmat.vertexShaderID: Unknown enum value TreeAdv

and then they appear as bright pink flashing objects in game.

Does anyone know a way around this?, or do we need a BI tool's update to get these new shaders to work?

Share this post


Link to post
Share on other sites

The official binarize doesnt know this shader and cant create a correct ODOL. Only way currently would be hex editing (or a tool) to set the wanted shader (and maybe ODOL version).

Share this post


Link to post
Share on other sites

thanks T_D, ill have a look into hex editing, I hope we get an updated version of binPbo soon

Share this post


Link to post
Share on other sites

I hope you are not searching for shader names in the ODOL file, because the shaders are saved as numbers as you can see here.

Share this post


Link to post
Share on other sites

yeah i was, thanks for the link :), but if thats the case then how can I find out the right ID number for the treeAdv shaders, which are'nt listed on that article?.

Share this post


Link to post
Share on other sites

Ok I found these values:

pixelshader:

TreeAdv - 114

TreeAdvTrunk - 116

vertexshader:

TreeAdv - 31

TreeAdvTrunk - 32

To apply the new shaders do the following:

1. Binarize your tree but dont use the new shader in the rvmats. Use an A2 shader instead.

2. Open the ODOL of the tree in a hex editor

3. Search for the path of the rvmat that you want to change the shader of

a) skip 105 bytes after the path and you are at the position of the pixelShader ID

b) pixelShader ID is an unsigned long (4 bytes) in little endian format

c) vertexShader ID directly follows the pixelShader ID

d) you just need to change the first byte of pixel and vertexshader ID to the wanted one (pixelshader ID of TreeAdv for example is 114 which would be 72 in hex, so you would set the first byte of pixelShader ID to 72)

4.) repeat step 3 until you changed all occurences of a certain material and do it for all materials you want to patch

This pic will help you to understand:

patchshader.png

The path of rvmat is marked yellow. This is what you have to search for. Blue is the 105 bytes gap. Red is the pixelshader ID and orange the vertexShader ID. You have to change the first byte of the red and orange markings.

Share this post


Link to post
Share on other sites

thanks for the info T_D, I just tried it out and it worked :), I've just used the _mc map I rendered for the 'tree' shader (A2) and modified it a bit (made it _MCA) for the 'treeAdv' shader, so it might not be exactly the right thing (or same as OA trees), but I've found that it can be used in pretty much the same way as the 'tree' shader for colour variation.

Its a great improvement on the older shader, I'd love to see what chenaurus trees could look like using it. I think that enough info could be extracted from the existing A2 _MC maps and converted to _MCA, I dont think it would be too big a task.

left: 'tree', right 'treeAdv'

arma2oa2010090622250298.th.jpg arma2oa2010090622335167.th.jpg

You can really see the difference in clarity in the alpha that the 'treeAdv' has over the 'tree' shader, im hoping it will be useful for making leafless deciduous winter trees, something I've found the 'tree' shader doesnt cope well with because you just end up with a bunch of gappy twigs as you can see above.

left: 'tree', right 'treeAdv'

arma2oa2010090622132225.th.jpg arma2oa2010090622055130.th.jpg

The .rvmats have quite different values for the 2 trees, I just used BIS settings (forgotten which one) for the 'treeAdv' .rvmat and i think it was a bit of a fluke that it came out looking alright considering how different my texture maps are.

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  

×