Jump to content
Elcoo

Rendering grass at long distances: My thoughts about it

Recommended Posts

great idea, it's time to implement something similar

Share this post


Link to post
Share on other sites

Looks pretty cool, BI should definitely review this.

Share this post


Link to post
Share on other sites
"Lag" is most commonly used to refer to internet latency. What you're describing is an FPS drop. Just FYI.

We're in a new age where words have no meaning. It has been a sad decline in correct terminology usage since PC gaming has grown ten-fold over the years.

Share this post


Link to post
Share on other sites
Wouldn't you just have to look for grassy bits in the distance and know someones there? And if they crawl you see a patch of grass moving? Would also like a better way even though i think what we have is "ok". Well better than nothing at all. :)

That game i forgot what it was called added grass within the scopes view only. Seemed to work great although im not sure it would work (or be too heavy) in our engine.

I was going to suggest this myself. A "Chia Pet" spot lamp effect.

Currently we use the Grass Shader to draw grass in a radius around the player at his current position. When you look through an Optical Device like a gun scope, we do the same thing only using the aimpoint in the scope as a reference. Since we narrow the field of view in a scope, we draw much less of the world and we dramatically increase FPS (at least, on my system anyways)... so we have some room to spend a little of the performance gain on using the Grass Shader. We just set the Grass Shader to draw grass in a radius slightly bigger then the FOV, so it draws new grass, removes old grass, just outside of the viewable frame as the FOV pans about .

Of course the challenge is.... can the shader draw grass fast enough to keep up with a rapidly shifting FOV and can we draw enough grass to cover the magnified view at all FOV levels of zoom. Less magnification would be harder and require more grass to be drawn. We'd also have to decide the distance and magnification thresholds for when we need to start drawing grass.

Combined with the OP's suggestion for unmagnified views of targets at a distance, it could be a cool effect that solves a long standing problem in our armaverse.

Share this post


Link to post
Share on other sites
I was going to suggest this myself. A "Chia Pet" spot lamp effect.

Currently we use the Grass Shader to draw grass in a radius around the player at his current position. When you look through an Optical Device like a gun scope, we do the same thing only using the aimpoint in the scope as a reference. Since we narrow the field of view in a scope, we draw much less of the world and we dramatically increase FPS (at least, on my system anyways)... so we have some room to spend a little of the performance gain on using the Grass Shader. We just set the Grass Shader to draw grass in a radius slightly bigger then the FOV, so it draws new grass, removes old grass, just outside of the viewable frame as the FOV pans about .

Of course the challenge is.... can the shader draw grass fast enough to keep up with a rapidly shifting FOV and can we draw enough grass to cover the magnified view at all FOV levels of zoom. Less magnification would be harder and require more grass to be drawn. We'd also have to decide the distance and magnification thresholds for when we need to start drawing grass.

Combined with the OP's suggestion for unmagnified views of targets at a distance, it could be a cool effect that solves a long standing problem in our armaverse.

Or write a grass shader which draws grass wherever you point your scope to just in the viewport of your scope.

Share this post


Link to post
Share on other sites
I was going to suggest this myself. A "Chia Pet" spot lamp effect.

Currently we use the Grass Shader to draw grass in a radius around the player at his current position. When you look through an Optical Device like a gun scope, we do the same thing only using the aimpoint in the scope as a reference. Since we narrow the field of view in a scope, we draw much less of the world and we dramatically increase FPS (at least, on my system anyways)... so we have some room to spend a little of the performance gain on using the Grass Shader. We just set the Grass Shader to draw grass in a radius slightly bigger then the FOV, so it draws new grass, removes old grass, just outside of the viewable frame as the FOV pans about .

Of course the challenge is.... can the shader draw grass fast enough to keep up with a rapidly shifting FOV and can we draw enough grass to cover the magnified view at all FOV levels of zoom. Less magnification would be harder and require more grass to be drawn. We'd also have to decide the distance and magnification thresholds for when we need to start drawing grass.

Combined with the OP's suggestion for unmagnified views of targets at a distance, it could be a cool effect that solves a long standing problem in our armaverse.

yeah I was thinking the same, or just simply multiplying the grass render distance by the magnification/zoom being used. Of course either way would cost more performance than currently but it is necessary if you ask me. Of course the OP's original idea would still be needed for unmagnified vision like you said. But together they would make spotting on a whole much harder and optics would actually be fairly balanced. It would also be amazing to have sniper counter sniper battles because you could actually use camoflauge. I hope BIS looks into at least some of the ideas put forth.

Share this post


Link to post
Share on other sites

I like the idea, but i wonder if the grass alpha layer is necessary? When the soldier is laying in grass but the grass is no longer visible he could just be transparent based on the distance to the player. The further the soldier is away from the player the more transparent he is, but the transparency should of course be capped so the soldier can not be completely invisible.

Share this post


Link to post
Share on other sites
I like the idea, but i wonder if the grass alpha layer is necessary? When the soldier is laying in grass but the grass is no longer visible he could just be transparent based on the distance to the player. The further the soldier is away from the player the more transparent he is, but the transparency should of course be capped so the soldier can not be completely invisible.

Without the Alpha layer the character model would become transparent in a evenly, uniform manor. Jike a Ghost, but the silhouette of the model would remain fairly, if not entirely, intact. The Alpha layer is designed to break up the silhouette like real camouflage is designed to do. It's the silhouette that often gives away the presence of an object and gets noticed in a scene more then the actual colors and pattern will.

Share this post


Link to post
Share on other sites
I like the idea, but i wonder if the grass alpha layer is necessary? When the soldier is laying in grass but the grass is no longer visible he could just be transparent based on the distance to the player. The further the soldier is away from the player the more transparent he is, but the transparency should of course be capped so the soldier can not be completely invisible.

That would be an okay solution to achieve some level of camouflage but the suggested one is more accurate as it would only show what is actually visible of the player. So if just his feet are covered by grass when standing, only his feet will be invisible, rather than his entire body being slightly transparent.

Edit:

Also what Spamurai said.

Share this post


Link to post
Share on other sites

Seems like a great method to help fix this glaring issue. There should be no reason someone beyond 500m in grass should be more visible than someone at 50m in grass.

Share this post


Link to post
Share on other sites

This is such a necessary improvement to the current long-distance draw method. It's been severely broken since ArmA (OFP maybe, I forget). There are 2 basic issues:

1. The "sinking" method doesn't actually sink far enough. Laying prone in waist-high grass results in no more than 10" of concealment...? I know from experience I can lay down in waist high grass and be ~100% concealed from people actively trying to find me.

2. Even then, models are super easy to pick out in binoculars/scopes because of the sharp contrast between vague, low-res land texture and the blocky, high-res models.

My only suggestion is to alter how the alpha is drawn depending on the angle of the terrain in relation to the player. What I mean by that is if the player is looking at a soldier who is lying on ground that is perfectly parallel to the player's eyesight, there should be a very high level of concealment (total) in anything other than well-trimmed lawn grass. You know, you can't see models more than 30m out when the full grass is being drawn, why can you see half of them at 500m? On the other hand, if you're looking down at someone, the angle is negative, and then the grass alpha should be drawn less.

I imagine there's a very easy math equation you can use to adjust the relative height of the alpha texture on the model.

http://i482.photobucket.com/albums/rr181/davidk594/alphas_zps3541c546.jpg (178 kB)

Edit:

I totally agree with NordKindchen that ghillies should be basically invisible. You could use the stock texture you provided and just add 50% height (through my adjustment system): there would be a very little bit of the model showing in some instances, and in hard rocky ground, most of it would show, but in most cases it would be effectively total concealment (as it should be).

Edited by DNK

Share this post


Link to post
Share on other sites

@DNK Thanks for your support.

I agree with your point too. Only that it may be too hard to implement. That doenst mean I wouldnt like it to be implemented=)

To underline our suggestions:

I have to point out again - if you lay down in waist high grass - you are not able to look out of the gras yourself! You are basically blind.

So making people disappear in high gras would not mean that they can shoot you without danger. its only a way to simulate real world behavior!

Best regards

Ps: Oh btw: I think this method would work really well together with the suggestions about the gras shown here:

Sophisticated considerations on how to get rid of the blurry mid range textures.

Edited by NordKindchen

Share this post


Link to post
Share on other sites

Yeah, that's the exact irrationality of the current system, and this solution is so simple and so problem-fixing and so non-performance-ruining that it's amazing it hasn't been thought of before.

It's really like they took the very lowest of all grass models to decide where to set the "sinking", which is the direct opposite of how they should've approached things given that over enough distance the tallest regular grass will decide the concealment (unless looking down angle, hence my suggestion).

---------- Post added at 09:51 AM ---------- Previous post was at 09:18 AM ----------

The basics: as soon as a player moves beyond the grass draw distance, the alpha starts to be applied. The texture is set, let's say, to a 250x1000px one, with considerable black space below the "grass" (simulating total concealment) and white space above that textured part (simulating total transparency). The texture height in relation to model height is such that shifting the image up by 250px would leave the model almost totally visible, while shifting it down by 250px would leave it almost totally concealed (while standing).

alpha2_zps7a3fa296.jpg

From this we can first shrink or expand the image in the vertical direction only depending on type of vegetation. Normal vegetation = 100% size; low vegetation = 50% size; none = no alpha applied; high vegetation = 200% size. This has the result that the "grass" portion of the alpha image shrinks, though the texture has large enough black/white space to accommodate full reveal/camouflage.

Next, we shrink both dimensions based on distance from the observer. I'm not sure exactly how this works out, but the math will be simple.

Finally, we adjust the dimensions based on the player's FOV. Higher FOV = greater shrinkage.

On to the angular adjustment...

Then we find the angle of the terrain tile under the feet of the subject (observed model) along the direction of view of the observer. Downward in the direction of the observer makes a negative number. Ranges from -90 to +90 (degrees). This is relative to horizontal.

Then we find the angle between the eyes of the observer and the feet of the observed (relative to horizontal). Also ranges from -90 to +90.

Now we take the pre-adjusted texture (from vegetation height, distance, FOV) and adjust it this way:

[center point height of image] = [pre-adjustment height] x -( ( sin( [angle of terrain] + [angle of viewer] ) ) x 0.25 )

So, looking at my 3 original situations in my other post, the first image comes out to an adjustment of +6% (a modest increase in visibility). The second comes out to +17% (a strong increase in visibility). The third comes out to -17% (a strong decrease in visibility). Remember that -25% or +25% center point height equals total concealment and total visibility.

This also works such that looking directly down at someone standing on a grassy cliff (in theory) would have the same effect as looking directly at someone standing on level grassy terrain, while looking down 45 degrees at someone standing on a 45 degree hillside (on your side) would be the same as looking directly down at someone from the sky. Perhaps that's not 100% realistic, but simply adjusting where the "grass" part of the texture stops on the upper side would ensure that there would be some base minimum amount of coverage for such scenarios.

I'll also add that computationally this shouldn't be very taxing at all to do for many models (perhaps even including buildings, trees, cars, etc), and could totally replace the current idiotic "sinking" method that's been around since the 90s.

Edited by DNK

Share this post


Link to post
Share on other sites

OP, great view and point, must be looked at..

Share this post


Link to post
Share on other sites

It all comes down to the midrange issue with textures, that midrange does not in anyway represent the enviroment in close range, even with that depth matte, the soldier would still be quite visible since theres almost no information around(in the midrange view), anything with a bit of depth sticks out.

Share this post


Link to post
Share on other sites

Great work, OP. A serious improvement on the current model, if you ask me.

Share this post


Link to post
Share on other sites

nice idea - maby the other idea is. push the gras clutter forward in the scope view to.

Share this post


Link to post
Share on other sites

Reminds me of JointsOps - iirc?! It turned your model into a green 'alpha'ed' thingy to make it harder for opponents to id you way too easily at distances were normally the grass isn't rendered. Wasn't there a dynamic viewdistance for scopes in VBS that makes grass appear to be rendered over larger distances?

Quite a good idea here.

Share this post


Link to post
Share on other sites

I´d like that too. Of course it´s harde but to me more realism = more fun.

Games like "Joint Operations" (anyone else knows that?) did a pretty good Job on that back in 2004, so it should be possible today. I didn´t read all of the eight pages so maybe this has been mentioned before but it should be self evident that aiming through high grass should also be harder then.

Edited by GefrBachmann

Share this post


Link to post
Share on other sites

I would like to see instead of a soldier at distance prone 'Morphing' into the floor i'd like to see something that at least depicts grass being around the subject.

Share this post


Link to post
Share on other sites

Boy I gotta try this Joint Op's because everytime a thread opens abouts whats needed in Arma - theres always a 'had it in Joint Ops...". :p

Must have been a helluva game.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×