Biro Posted August 9, 2007 Author Share Posted August 9, 2007 Got more detailed info to my previous answer. You have to make sure that the areas you want to be transperant are truly black (0,0,0), all other values are seen as white (1,1,1) no mather with drak or light grey it is. Yes, I think the engien smoothes texture edges against transperancy a little. It does the same when water planes intersect with other geometry as well. Yes, I found out this last night aswell Wolfsong. The problem I had though wasn't because something was wrong with my texture. The error occured when I used Atlasgen and compressed the texture. Dunno what happened really so I just saved over the exported texture with photoshop and it was nice and clean again. Thnx for the info for the water btw...will be useful on the map I'm working on! Quote Link to comment Share on other sites More sharing options...
GRIN_Wolfsong Posted August 9, 2007 Share Posted August 9, 2007 Got more detailed info to my previous answer. You have to make sure that the areas you want to be transperant are truly black (0,0,0), all other values are seen as white (1,1,1) no mather with drak or light grey it is. Yes, I think the engien smoothes texture edges against transperancy a little. It does the same when water planes intersect with other geometry as well. Yes, I found out this last night aswell Wolfsong. The problem I had though wasn't because something was wrong with my texture. The error occured when I used Atlasgen and compressed the texture. Dunno what happened really so I just saved over the exported texture with photoshop and it was nice and clean again. Thnx for the info for the water btw...will be useful on the map I'm working on! I think you'll have to specify the texture type when using the atlas tool. You also can't mix textures of different types in the same atlas. Diffuse with or without spec/alpha should be DXT5. Quote Link to comment Share on other sites More sharing options...
Biro Posted August 10, 2007 Author Share Posted August 10, 2007 Yes I used AF_DXT5 in the atlas file, but didn't work, but this doesn't mather. It's working as it is and that's enough for me. But...(and there's always a but ) I have some more questions offcourse. Still related to trees and vegetation. Answear them if you can Wolfsong I'll take them in numbers, makes it easier to keep the overview of: 1. instance_struct="world_tm_ambient_cube This line has to be used on all objects that has the "instanced" shader on them, but what is the sole purpose of it? Is it only related to game perfomance and why don't have it on all objects? How can we use it as best as possible? 2. Culling object My english ain't the best so I'm wondering what the culling object is doing aswell? I see that the trees you have in GRAW2 is working in the way that the foliage is always "facing" you no mather how you turn. Is the culling object set as some sort of helper for this operation, or does it serve other or more purposes? This is somewhat related to this lines of coding: <effect_surface name="leaves" culling_object="cull_all" far_distance_clip="2000" culling_radius="6000" object="efx_plane" effect="falling_leaves_from_tree" spawn_rate="0.2" active="true"/> <object name="billboard_group:leafy" shadow_caster="true" instance_struct="leaves"/> I understand that this line create the falling leafs effect and I see that you also have the culling_object in here. I'm also wondering what the <object name="billboard_group:leafy has for purpose and if the instance_struct="leaves" has something to do with this and if I need any special shader together with this? (leaves_translucency) 3. Any way to set a material to 2 sided like you can do in the material editor in 3dMax. Like you for example can use on fences made out of wires or leafes on trees or grass...? I searced around, but I couldn't really find any good answears to this neither in the material or the model files. 4. Can you write a short comment about the last 4 lines here and what their purpose is? <material name="bush" src="leaves_translucency"> <diffuse_texture file="vgt_tree_bigold_df"/> <opacity_texture file="vgt_tree_bigold_df"/> <bump_normal_texture file="vgt_tree_bigold_bm"/> <clip_plane value="0 0 -1 25000"/> <variable name="settings" type="vector3" value="300 2 1.0"/> <filter_color_texture file="vgt_translucency_mask"/> <variable name="translucency_fresnel_power" type="scalar" value="10"/> <variable name="translucency_multiplier" type="scalar" value="1"/> </material> Thnx for help so far Wolfsong, we gotta use you as much as possible now before your gf is back! Quote Link to comment Share on other sites More sharing options...
Tinker Posted August 10, 2007 Share Posted August 10, 2007 Wish you luck Biro, looks like a nightmare to me. But i hope you get things going there. Quote Link to comment Share on other sites More sharing options...
GRIN_Wolfsong Posted August 11, 2007 Share Posted August 11, 2007 You're not starting out lightly are you... Plants are a special type of props which one 1 person at work actually have full knowledge of, but I'll answer the parts that are common for normal props as well. As a suggestion to other modders, don't start with vegetation until you've mastered normal props. 1. instance_struct="world_tm_ambient_cube This line has to be used on all objects that has the "instanced" shader on them, but what is the sole purpose of it? Is it only related to game perfomance and why don't have it on all objects? How can we use it as best as possible?It's related to performance. It works just like when you instance something in Max. It only has to have 1 version or the object in memory and then it can have multiple locations where it can be found which are used when rendering. It should be on all objects that are common and can be seen on screen at least 4-5 at the same time and are not dynamic/destroyable. So not everything should be instanced. To instance a model use the line instance_struct="world_tm_ambient_cube" which makes them instanced and allows each instance to sample it's own ambient cube value from it's placement location to give it the correct lightness/darkness in it's environment. When a model is instanced, all it's materials must also be instanced. You can not use an instanced materials on a non-instanced model. 2. Culling object My english ain't the best so I'm wondering what the culling object is doing aswell? I see that the trees you have in GRAW2 is working in the way that the foliage is always "facing" you no mather how you turn. Is the culling object set as some sort of helper for this operation, or does it serve other or more purposes? This is somewhat related to this lines of coding: <effect_surface name="leaves" culling_object="cull_all" far_distance_clip="2000" culling_radius="6000" object="efx_plane" effect="falling_leaves_from_tree" spawn_rate="0.2" active="true"/> <object name="billboard_group:leafy" shadow_caster="true" instance_struct="leaves"/> I understand that this line create the falling leafs effect and I see that you also have the culling_object in here. I'm also wondering what the <object name="billboard_group:leafy has for purpose and if the instance_struct="leaves" has something to do with this and if I need any special shader together with this? (leaves_translucency) Culling objects are used to limit rendering. The most common culling object is found in landscapes or large props, which simply tells the computer to ignore anything behind them when rendering the current view. Which is good for performance of course. In landscapes such objects should be placed where the landscape naturally covers another part of the level. All culling objects uses the "bounding box" shape of the culling object. Which means that are always box shaped. Culling objects can also be used on effects which limits the area an effect will spread inside. In the case of the tree, the falling leaves will disappear when they go outside the culling box surrounding the tree. The billboards are used to always point towards the player. It's simply a plane with a texture on it what always has it's face normal towards the player. That way a think tree can be made with very few branch planes, which saves performance. I don't have the knowledge on how to setup billboards though. And as you see, the leaves have a special instance_struct="leaves" that is uses, which probably has some specific features just for them. 3. Any way to set a material to 2 sided like you can do in the material editor in 3dMax. Like you for example can use on fences made out of wires or leafes on trees or grass...? I searced around, but I couldn't really find any good answears to this neither in the material or the model files.No, you'll have to have 2 planes if you want to make it double sided. 4. Can you write a short comment about the last 4 lines here and what their purpose is? <material name="bush" src="leaves_translucency"> <diffuse_texture file="vgt_tree_bigold_df"/> <opacity_texture file="vgt_tree_bigold_df"/> <bump_normal_texture file="vgt_tree_bigold_bm"/> <clip_plane value="0 0 -1 25000"/> <variable name="settings" type="vector3" value="300 2 1.0"/> <filter_color_texture file="vgt_translucency_mask"/> <variable name="translucency_fresnel_power" type="scalar" value="10"/> <variable name="translucency_multiplier" type="scalar" value="1"/> </material> First, you don't need the <clip_plane value="0 0 -1 25000"/> part on many objects. It's an override that tells the engine to not cull away this texture until it's 25000 centimeters from the player. The standard culling is done at 15000 of course, which is 150 meters. It's needed for the top parts of trees and other objects that gives the silhouette of the map from a distance. Doesn't work on all objects though as it depends on the objects type (slot). <filter_color_texture file="vgt_translucency_mask"/>Decides which transluceny mask to be used with the material. Translucency is shadows and light seen though materials, like on a paper wall. <variable name="translucency_fresnel_power" type="scalar" value="10"/> is used adjust the Fresnel power of the translucency, as the line says. <variable name="translucency_multiplier" type="scalar" value="1"/> is used to set how transparent the translucency should be. Which can be adjusted here instead is adjusted inside the texture. As for <variable name="settings" type="vector3" value="300 2 1.0"/>, I haven't got a clue right now. I can check it out on Monday. If you don't know what translucency is, I suggest checking around on the internet for more info on the phenomena. Quote Link to comment Share on other sites More sharing options...
Biro Posted August 11, 2007 Author Share Posted August 11, 2007 You're not starting out lightly are you... No guts, no glory! Well I've got the normal props pretty much covered as that wasn't too hard to figure out of. The trees though, as you said are more complex and it's a bit of a pain to figure out of it and how to set it up as best as possible for different types of trees. The "billboard" effect is nice, but it's not suitable on all kind of trees...like this one, but maybe I'll figure out how to use it here aswell after some more tests. The translucency effect can be nice, but I gotta do some more tests and see what I can figure out of it. I guess this effect only works when the map is lightmapped so have to consider it up against the resources this use. Anyway, thanks again for really good answears Wolfsong! I'm pretty damn sure modders here wouldn't come very far without your help! Quote Link to comment Share on other sites More sharing options...
GRIN_Wolfsong Posted August 11, 2007 Share Posted August 11, 2007 Your welcome. Quote Link to comment Share on other sites More sharing options...
GRIN_Wolfsong Posted August 14, 2007 Share Posted August 14, 2007 Asked about this: <variable name="settings" type="vector3" value="300 2 1.0"/> It's just an extra variable to adjust the radial gradient which creates darker centers on a billboard shader. You don't need to use any of the "variable" tags in a shader, they are optional. Quote Link to comment Share on other sites More sharing options...
Biro Posted September 2, 2007 Author Share Posted September 2, 2007 Wolfsong, if you read this, any chance you could talk to the tree guy at your office and ask how he setup the trees to get the billboard effect with the normal always facing the player? Have tried a bunch of different grouping and different naming on the helpers, deleted and added things in both the originals and my model xml files, but no luck so far. It's gotta be setup inside max, but it's pretty damn hard to figure out of it. Have some decent trees setup now without this effect, so I'll just go with that if we can't get an answear to this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.