JeffR Posted February 5, 2015 Share Posted February 5, 2015 One area that Torque is somewhat lacking in is in good foliage.Part of it is not having dedicated shader/shader features to handle lighting on it properly, but another aspect is that not many people have pushed it on the art side - a few people have done good work with it, but not too many.Given that foliage is a pretty major part of many environments, having good examples, tutorials, and source art can be a major tool in making better foliage for the enviornments in games that need it.We've seen Torque can do a pretty good job with foliage when it needs to, as seen in the old South Pacific demo:http://ghc-games.com/public/Pacific.pngHowever, currently those assets are closed off to us, and even then they're falling behind on the modern standards in effect now.I've spent a fair bit of time drudging through tutorials and examples, and while I can't say anything is definitively "The Best" way, there are definitely some examples that could be pointed to as good baselines.So I figured I'd start a thread here for people to discuss methods, tutorials they found and provide examples if they choose.To start, I had stumbled upon a tutorial done by a guy on the Cry Engine forums that was both rather thourough, and produced excellent results for grass.The tutorial is here: http://www.cryengine.com/community/viewtopic.php?f315&t=100319And the results are thus:http://ghc-games.com/public/grass_med_finished.jpgSo I started testing his approach out, and while it's not 100% it's most of the way there. The results are pretty solid:In the viewport, on the grass mesh:http://ghc-games.com/public/viewport_wip_grass.pngAnd the texture I rendered for it, per the tutorial:http://ghc-games.com/public/Grass_Texture.pngSo that's my current foray into the grass side of foliage stuffs.For it to be perfect, we'd still need shaders that handle the lighting on foliage better(managing backface lighting so they look like they're more volumous, etc), but the first step is to have good textures and models.Feel free to give that tutorial method a try, and see if there are improvements that can be made! I'll be putting up the blender source file for my efforts on it in the near future. Quote Link to comment Share on other sites More sharing options...
buckmaster Posted February 5, 2015 Share Posted February 5, 2015 Looking pretty great. This looks like the sort of luscious green grass that would be great in a default template of some kind. Quote Link to comment Share on other sites More sharing options...
andrewmac Posted February 6, 2015 Share Posted February 6, 2015 Now, post screenshots of your new grass in Torque :PI'll do a little research and see what I can find for a grass shader. Quote Link to comment Share on other sites More sharing options...
buckmaster Posted February 6, 2015 Share Posted February 6, 2015 Oh whoops, I thought that first screen was Torque. Should have known it was suspiciously good :P. Quote Link to comment Share on other sites More sharing options...
JeffR Posted February 8, 2015 Author Share Posted February 8, 2015 Oh whoops, I thought that first screen was Torque. Should have known it was suspiciously good :P. The first screen is Torque, from the Pacific Demo. Unless you mean the screen that's nothing but grass. Then yes, that's CryEngine. Now, post screenshots of your new grass in Torque :PI'll do a little research and see what I can find for a grass shader. I'll see about getting it in there tomorrow.As for grass shader stuffs, 2 major elements I've seen from CryEngine's handling of it is 2 modifiers. One handles how much backfacing shadows lit polies, and the other handles how much backfacing shadows polies that are in the shade.I spotted them because the dude that did the grass tut was complaining that they're broken in one of the latest versions of the engine, and provided image references.http://www.cryengine.com/community/viewtopic.php?f=369&t=76715&p=1233484#p1233484As you can see in his images, it manipulates how the grass is lit and goes a long way to making it feel like it has volume and avoids the weird flat-poly backshading effect.I'd imagine the basis of the fields is pretty simple, just impact how much pixels on a backfacing poly accept shading when lit and in shadows. Quote Link to comment Share on other sites More sharing options...
Kyrah Abattoir Posted February 9, 2015 Share Posted February 9, 2015 Tried the trick of flipping the Z axis on the normal map of the grass? Quote Link to comment Share on other sites More sharing options...
JeffR Posted February 10, 2015 Author Share Posted February 10, 2015 I had not, but in the long run, it seems somewhat poor form to require artists to do special proprietary workarounds to get their art to work in the engine.It'd probably work as a stopgap solution, but updating the lighting stuffs to properly accommodate foliage is a better long-term plan. Quote Link to comment Share on other sites More sharing options...
Gibby Posted February 11, 2015 Share Posted February 11, 2015 Looking forward to seeing what you do with this Jeff. I worked with Cry for quite a bit and came back to T3D - still missing the environments from CryEngine... Quote Link to comment Share on other sites More sharing options...
rlranft Posted February 11, 2015 Share Posted February 11, 2015 Yeah, the normal map z flip is an issue with the material editor I believe. Have to look at it though. Quote Link to comment Share on other sites More sharing options...
Nils Posted February 11, 2015 Share Posted February 11, 2015 You can do without shaders...Animated 3d ground cover in T3D, so no billboards!All in-game, so no crytech-style demo level! Quote Link to comment Share on other sites More sharing options...
JeffR Posted February 11, 2015 Author Share Posted February 11, 2015 @NilsInteresting. How did you set up the materials/models so they don't deal with backshading? Quote Link to comment Share on other sites More sharing options...
Nils Posted February 11, 2015 Share Posted February 11, 2015 (edited) @NilsInteresting. How did you set up the materials/models so they don't deal with backshading? Very planar; a few planes stuck together with animated double-sided texture and one extra LOD with an auto-billboard. A bit of AO to simulate a bit of shadow, in T3D it doesn't come out very strong but without shadows (bugged) it runs smoother anyway. No costly shaders, no normal maps. If you need to render so many shapes it's best to strip it all clean. All the ground cover objects in the the pic share the same atlas map. Edited February 11, 2015 by Nils Quote Link to comment Share on other sites More sharing options...
Nils Posted February 11, 2015 Share Posted February 11, 2015 So stripped from everything that decreases performance you can really populate the shape in great numbers and still run perfectly in-game.The 1920 x 1080 shot below is taken with all settings to max (AA 4x, FA 16x etc.) with a 3 year old graphics card and still it's >40fps Quote Link to comment Share on other sites More sharing options...
JeffR Posted February 11, 2015 Author Share Posted February 11, 2015 I'm still not sure how you're not seeing shading on polies that face away from light sources like the sun though. That's the single biggest cause of ugly foliage in T3D.Also, what's the tri count on your high-res grass mesh?Pretty awesome shot there at though :) Quote Link to comment Share on other sites More sharing options...
Nils Posted February 12, 2015 Share Posted February 12, 2015 I'm still not sure how you're not seeing shading on polies that face away from light sources like the sun though. That's the single biggest cause of ugly foliage in T3D. That's because the downwards facing mesh normals will appear too strong on ground cover objects in T3D. You can edit the normals in your 3d application to make them look brighter by pushing them upwards. Also, what's the tri count on your high-res grass mesh? The green grass mesh in the 1st shot has 27 vertices at LOD 0 and 4 at LOD 1 (auto billboard) Quote Link to comment Share on other sites More sharing options...
andrewmac Posted February 12, 2015 Share Posted February 12, 2015 Would a potential engine side solution be a material property that overwrites the normals that are writtten into the gbuffer for that material with upward facing ones? You could enable it on the grass material and the grass would be lit as though it had all upward facing normals. Quote Link to comment Share on other sites More sharing options...
Nils Posted February 12, 2015 Share Posted February 12, 2015 Would a potential engine side solution be a material property that overwrites the normals that are writtten into the gbuffer for that material with upward facing ones? You could enable it on the grass material and the grass would be lit as though it had all upward facing normals. For the lazy artist it would be handy solution :P :P :P Editing normals in a 3d application is work that can be done in a matter of seconds. An artist could choose to fine tune the normals to fake a bit of shadow; of course depending on the amount of faces used in the mesh. Quote Link to comment Share on other sites More sharing options...
JeffR Posted February 12, 2015 Author Share Posted February 12, 2015 Well, for example, blender doesn't have very good tools for manually editing normals.As well as if you're trying to use art packs in the engine - needing to crack those open and manually fix them is kind of an annoying step that slows down prototyping and the like.It's not a hard fix, but streamlining the art pipeline is generally a good thing where possible ;) Quote Link to comment Share on other sites More sharing options...
andrewmac Posted February 12, 2015 Share Posted February 12, 2015 Maybe if the normals were just weighed heavily in the Z+ direction using a configurable value in the material from 0 - 1. That way it wouldn't be so cut and dry as all upward facing normals, but instead let you scale the normals towards Z+ using a value from 0 - 1.I'm trying to avoid having to place a new material info flag into the gbuffer to flag foliage and light it differently. If I could provide a workable solution from altering the normals before the lighting stage that would be ideal. Worse case scenario I'll just bite the bullet and make a custom lighting flag for foliage. Quote Link to comment Share on other sites More sharing options...
Steve_Yorkshire Posted February 12, 2015 Share Posted February 12, 2015 @Nils Looks nice! Any video? 8-) Quote Link to comment Share on other sites More sharing options...
Nils Posted February 13, 2015 Share Posted February 13, 2015 Ha yes, @JeffR, probably you're right about that.I found that changing the normals is really about giving those the right angle, not just abruptly all straight up. That would just kill the normals on the mesh and make it look completely flat. In T3D there's a threshold; beyond 90° (see pick) normals do look much better. You'd want to change them all at once to avoid having normals that don't look normal ;) Perhaps giving the artist the possibility to put in an angle? @Nils Looks nice! Any video? 8-)@Steve_Yorkshire We're working utterly hard to create a teaser video. More soon! :D :D :D Quote Link to comment Share on other sites More sharing options...
Chieling Posted February 13, 2015 Share Posted February 13, 2015 What is the performance/comparison between the normal billboard grass and this style? Quote Link to comment Share on other sites More sharing options...
Nils Posted February 13, 2015 Share Posted February 13, 2015 @Chieling Rendering 3d shapes is obviously much more costly then billboards. It takes at least twice as much performance decrease; whole depending on the amount of vertices, LOD's and render distance. For that you gain groundcover that will not turn with the camera and can be seen from any angle; also from top. Art-wise, you can't go on using billboards in 2015 without a clear purpose or some kind of style or statement (a 90's retro look for example). Billboards would do fine on low-end hardware like tablets and such though :) Quote Link to comment Share on other sites More sharing options...
Chieling Posted February 13, 2015 Share Posted February 13, 2015 Oh, i completely understand the need to keep up with the art, but this is also a question of resource allocation and how much, what kind of cost, etc that i need to plan for. Quote Link to comment Share on other sites More sharing options...
AndyWright Posted February 14, 2015 Share Posted February 14, 2015 The problem I always had with grass is the way torque seems to handle its transparrent textures, Whenever I had grass that I was happy with in a screenie like Nil's one above, it always used to get funky when looking at water or the sky behind it, Z ordering problems i believe 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.