Boothand Posted February 11, 2014 Posted February 11, 2014 Here's another one of my attempts at creating stuff from scratch, with 3DS Max and (barely) Photoshop. I still think the tree looks a bit confused, and it's been some months since I last worked on it, but it honestly looked a bit better than what I expected in the beginning. 426 triangles currently. Trees aren't lightmapped yet. Would like some feedback on what could be better. therfiles likes this
IrocJeff Posted February 11, 2014 Posted February 11, 2014 So fuzzy looking. Not in a bad way. They could be Noble pines.
Psyk0Sith Posted February 11, 2014 Posted February 11, 2014 Doesnt quite look like a pine tree yet, they have big branches stuck to the trunk, in reality it should be a network of small branches.Reference:http://digitalholeinone.com/trees-textures-materials/free-tree-textures/free%20pine%20tree%20digitalholeinone%202IMG_2412.pngTuts:http://www.polycount.com/forum/showpost.php?p=1020341&postcount=9 http://www.polycount.com/forum/showthread.php?p=1384931http://www.andyzibits.com/tut_particle_tree_generation.htmlhttp://www.game-artist.net/forums/support-tech-discussion/11251-trees-beginners-3ds-max-tutorial.htmland there's even a script:http://www.scriptspot.com/3ds-max/scripts/tree-maker Boothand and Futuza like this
Futuza Posted February 12, 2014 Posted February 12, 2014 Huh That tree script maker thing looks pretty cool.
Boothand Posted February 12, 2014 Author Posted February 12, 2014 Doesnt quite look like a pine tree yet, they have big branches stuck to the trunk, in reality it should be a network of small branches.Reference:http://digitalholeinone.com/trees-textures-materials/free-tree-textures/free%20pine%20tree%20digitalholeinone%202IMG_2412.png Tuts:http://www.polycount.com/forum/showpost.php?p=1020341&postcount=9 http://www.polycount.com/forum/showthread.php?p=1384931 http://www.andyzibits.com/tut_particle_tree_generation.html http://www.game-artist.net/forums/support-tech-discussion/11251-trees-beginners-3ds-max-tutorial.html and there's even a script:http://www.scriptspot.com/3ds-max/scripts/tree-maker Thanks for the links! I think I'll find them very handy, except I won't use a script for it. I still have too much to learn I followed this tutorial, if you skip through it a few places you'll see where I was coming from: I'll try to see if I can make a more true to life edition though!
NumberWan Posted February 13, 2014 Posted February 13, 2014 I think the only problem with the pine tree is that we see it the very light environment. In any other map the pine would work just perfectly, I think. As for the similarity, I am not sure that is needer: hey, you are creating a model for a Star Wars game! The trees there might not look the way we see them in our life. I have a question regarding the shaders of the branches. Sometimes they would behave nasty in the game, so I wonder, does the shader works fine with the pine? What I mean, is that the shader for hair, leaves and other staff which deals with alpha channel of tga or a png file sometimes works weirdly. Funny thing: in the past it was so hard to create a world which wouldn't look like ours, and now we all try to recreate the perfect reality.
Boothand Posted February 13, 2014 Author Posted February 13, 2014 I think the only problem with the pine tree is that we see it the very light environment. In any other map the pine would work just perfectly, I think. As for the similarity, I am not sure that is needer: hey, you are creating a model for a Star Wars game! The trees there might not look the way we see them in our life. I have a question regarding the shaders of the branches. Sometimes they would behave nasty in the game, so I wonder, does the shader works fine with the pine? What I mean, is that the shader for hair, leaves and other staff which deals with alpha channel of tga or a png file sometimes works weirdly. Funny thing: in the past it was so hard to create a world which wouldn't look like ours, and now we all try to recreate the perfect reality. You're right that it could probably be good enough for certain maps or certain standards. My real goal is to improve my skills though, and prepare myself for making content for games. I would really like to have the consistency to be able to re-do something I've made, expand my logical thinking, and generally just the process of taking feedback and trying to improve what you're making. That's an important skill to learn even if it might be starting to look nice. Hmm in what way do these shaders work weirdly? This works fine though, it's just a simple shader using the alpha channel for transparency. I'd have to do some more changes to the shader probably when this tree is lightmapped, because it will cast shadows on the other branches and might have some unnatural dark spots etc. I guess I'm quite fascinated with trying to re-create real world stuff in games But I guess I find gameplay mechanics even more interesting on that area though. Stylized graphics is often a much more well-working approach on engines like this.
Boothand Posted February 13, 2014 Author Posted February 13, 2014 @@Psyk0Sith, I think maybe a bit of the issue is that it's not translated well into the game engine. I started working on a new texture for the branches, but when I opened 3DS Max, I realized that what I already had actually wasn't so bad. Here is the exact same tree that I took screenshots if in-game, but in 3DS Max: I think the shader is trying to go all-or-nothing on visibility. I seem to remember I can't have a $lightmap stage if I want gradual transparency. What do you think about the tree as it looks in Max? And if it looks good, what approach would you take shaderwise? therfiles likes this
Psyk0Sith Posted February 13, 2014 Posted February 13, 2014 You're right, it looks much better in max. I don't know enough about environment creation in JA to provide a quick fix. Take a look at the first level's assets to see what kind of shader was used for the trees. Boothand likes this
Boothand Posted February 13, 2014 Author Posted February 13, 2014 Actually I was partially right/wrong. What was in 3DS Max was a different texture (made for building the pieces of the branches) but which turned out better visually. Using shader methods taken from SP, I turn out with some issues. Each individual branch looks good, but they don't blend correctly with their fellow branches and other shaders, like the water in the background. Didn't wanna start a new thread for this, but I can do it if you (or anyone reading) don't know what it could be. https://dl.dropboxusercontent.com/u/58757568/buggyBranches.jpg models/map_objects/bootland/trees/pinestem4 { cull disable surfaceparm noimpact surfaceparm nomarks surfaceparm nonsolid { map models/map_objects/bootland/trees/pinestem4.tga blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA } { map $lightmap rgbGen identity blendFunc GL_DST_COLOR GL_ZERO } }
Boothand Posted February 23, 2014 Author Posted February 23, 2014 @@Szico VII, do you perhaps know anything about the issue in my previous post?
Szico VII Posted February 23, 2014 Posted February 23, 2014 For discrete transparency you should really be using the alphafunc GE128 (or LT 128) command.If for somereason you really need gradual transparency youll need a depthfunc equal in the lightmap stage. Oh, and dont forget to ad the "lightmapped" spawnflag to the model in radiant.,
Boothand Posted February 24, 2014 Author Posted February 24, 2014 For discrete transparency you should really be using the alphafunc GE128 (or LT 128) command.If for somereason you really need gradual transparency youll need a depthfunc equal in the lightmap stage. Oh, and dont forget to ad the "lightmapped" spawnflag to the model in radiant., Hmm yeah I had already tried the GE128 + the depthfunc equal option I'm afraid, and it gives me all-or-nothing transparency. It looks good from a distance, but loses some credibility up close compared to what I had in the previous shader (although very buggy and unusable). I replaced blendFunc with the alphaFunc, otherwise it had no effect. Wasn't aware of the lightmap ("lighted") spawnflag! Thanks. I can't quite realize the difference between blendfunc and alphafunc and their roles in each others' lives. Further suggestions appreciated!
Szico VII Posted February 24, 2014 Posted February 24, 2014 textures/blueice_nightfall/nightfall_treebranch { qer_editorimage textures/blueice_nightfall/nightfall_treebranch qer_trans 1.0 q3map_onlyvertexlighting surfaceparm nonopaque surfaceparm trans surfaceparm nonsolid cull twosided { map textures/blueice_nightfall/nightfall_treebranch alphaFunc GE128 depthWrite rgbGen vertex } }Thats the nightfall shader -> worked pretty well to be fair. It uses vertex lighting to save on compile time but still looks fine.For a tree branch, do you not want all or nothing transparency? Its not like some bits of twigs are partially transparent are they? For gradual transparency with lightmaps, particularly used for already partially transparent surfaces + additional alpha blending, the "depthfunc equal" seems to be the magic parameter, otherwise you get the lightmap showing up and ruining the gradual blend even if the texture itself has successfully faded away ) AFAIK, Alphafunc describes how to use the alpha channel by the renderer, and blendfunc describes how various texture layers are mixed with each other. Theres a lot of duplicate commands too, for example blendfunc GL_ONE GL_ONE is identical to blendfunc add, and blendfunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA I think is the same as blendfunc blend. EDIT:Heres the documentation in the shader manual: http://q3map2.everyonelookbusy.net/shader_manual/ch6.htm ALSO - Use cull twosided
Boothand Posted February 24, 2014 Author Posted February 24, 2014 textures/blueice_nightfall/nightfall_treebranch { qer_editorimage textures/blueice_nightfall/nightfall_treebranch qer_trans 1.0 q3map_onlyvertexlighting surfaceparm nonopaque surfaceparm trans surfaceparm nonsolid cull twosided { map textures/blueice_nightfall/nightfall_treebranch alphaFunc GE128 depthWrite rgbGen vertex } }Thats the nightfall shader -> worked pretty well to be fair. It uses vertex lighting to save on compile time but still looks fine.For a tree branch, do you not want all or nothing transparency? Its not like some bits of twigs are partially transparent are they? For gradual transparency with lightmaps, particularly used for already partially transparent surfaces + additional alpha blending, the "depthfunc equal" seems to be the magic parameter, otherwise you get the lightmap showing up and ruining the gradual blend even if the texture itself has successfully faded away ) AFAIK, Alphafunc describes how to use the alpha channel by the renderer, and blendfunc describes how various texture layers are mixed with each other. Theres a lot of duplicate commands too, for example blendfunc GL_ONE GL_ONE is identical to blendfunc add, and blendfunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA I think is the same as blendfunc blend. EDIT:Heres the documentation in the shader manual: http://q3map2.everyonelookbusy.net/shader_manual/ch6.htm ALSO - Use cull twosided If you compare this one @ all-or-nothing transparency with this one @ gradual trasparency, you probably see what I mean. Hard vs soft edges. I'm trying to replicate how it looks in 3DS max as closely as possible. The current shader is thus: models/map_objects/bootland/trees/pinestem4 { cull disable surfaceparm noimpact surfaceparm nomarks surfaceparm nonsolid { map models/map_objects/bootland/trees/pinestem4.tga alphafunc GE128 } { map $lightmap rgbGen identity blendFunc GL_DST_COLOR GL_ZERO depthfunc equal } } Actually now that I think about it, I recall failing to implement gradual transparency with lightmapped shaders, in a previous thread. Surprised I didn't realize that before. You answered that one actually! If it's still undoable in 2014, it's fine the way it is though (although it seems almost that only a bug is holding it back..) By the way, you said to use twosided. Does it differ from cull disabled, which I had?
Szico VII Posted February 24, 2014 Posted February 24, 2014 It just looks like the alpha channel isnt very good to me. No, actually, I dont think twosided is any different from none. Have you tried adding "depthWrite" to your main texture stage? You can have lightmapped gradual transparency, you just need the right lightmap stage as mentioned in last post using depthfunc equal - Ive recently used it for lightmapped alpha faded water in the Bioshock map. DOnt know about how it works with a alpha blend in the texture itself.... models/map_objects/bootland/trees/pinestem4 { cull disable surfaceparm noimpact surfaceparm nomarks surfaceparm nonsolid q3map_alphashadow { map models/map_objects/bootland/trees/pinestem4.tga alphafunc GE128 depthWrite } { map $lightmap rgbGen identity blendFunc filter depthfunc equal } }Or, perhaps for gradual...: models/map_objects/bootland/trees/pinestem4 { cull disable surfaceparm noimpact surfaceparm nomarks surfaceparm nonsolid q3map_alphashadow { map models/map_objects/bootland/trees/pinestem4.tga blendFunc blend depthWrite } { map $lightmap rgbGen identity blendFunc filter depthfunc equal } }
Boothand Posted February 24, 2014 Author Posted February 24, 2014 Your first shader works for non-gradual transparency (looks the same way as before), but the second one leaks. I remember I tried some things that caused that before I posted here, but yes it gives gradual transparency, although it leaks. The blendfunc blend causes it. The branch texture is WIP/placeholder but it's not too far away from what I want. The alpha channel seems fine though.
Szico VII Posted February 24, 2014 Posted February 24, 2014 Well I couldnt get it to work with a full lightmap, but with onlyvertex lighting it works just as well textures/blueice_nightfall/nightfall_treebranch { qer_editorimage textures/blueice_nightfall/nightfall_treebranch qer_trans 1.0 q3map_onlyvertexlighting surfaceparm nonopaque surfaceparm trans surfaceparm nonsolid cull twosided { map textures/blueice_nightfall/nightfall_treebranch blendfunc blend rgbGen vertex } } #01 Vertex Lit with blendfunc blend #02 Lightmapped with alphafunc GE128
Boothand Posted February 24, 2014 Author Posted February 24, 2014 Hmm. That leads me right back to this problem again. Collides with itself + other shaders. Current shader: models/map_objects/bootland/trees/pinestem4 { cull disable surfaceparm noimpact surfaceparm nomarks surfaceparm nonsolid q3map_onlyvertexlighting { map models/map_objects/bootland/trees/pinestem4.tga blendFunc blend rgbGen vertex } }
Szico VII Posted February 24, 2014 Posted February 24, 2014 It doesnt for me... Perhaps you could send me whatever model + test map you are using to see If I can duplicate it
Boothand Posted February 24, 2014 Author Posted February 24, 2014 It doesnt for me... Perhaps you could send me whatever model + test map you are using to see If I can duplicate it Here's a testmap: https://dl.dropboxusercontent.com/u/58757568/testmapBoothand.pk3Thanks for your time! Granted, the water shader is totally broken and for months untouched, but the pinetree also crashes with itself and its fellow pinetrees. testregion3.bsp
Szico VII Posted February 24, 2014 Posted February 24, 2014 models/map_objects/bootland/trees/pinestem4 { q3map_alphashadow surfaceparm nonsolid surfaceparm nonopaque surfaceparm trans cull twosided { map models/map_objects/bootland/trees/pinestem4 alphafunc GE128 rgbgen vertex } { map models/map_objects/bootland/trees/pinestem5 blendfunc blend rgbgen vertex } }I got around it by using 2 opacity stages. The first (GE128) gives you the blocking effect and transparency, and then the overlaying blendfunc gives you the smoothed edges. You'll need 2 separate alpha images, I made the pinestem5 alpha slightly larger and the pinestem4 (for the GE128) slightly smaller using darkness tool in photoshop. This IS 2 rendering passes though so for a lot of trees will take a performance hit, presumably. You can adjust the alpha at your own discrepancy NB: I also made it blocksize 0, removed the lightgrid worldspawn key added basic lighting. (And changed water for effect ) Boothand likes this
Boothand Posted February 24, 2014 Author Posted February 24, 2014 Fantastic, as always I'll make sure to learn something from this. Thanks for the effort!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now