Jump to content

Photo
- - - - -

Rendering grass at long distances: My thoughts about it


  • Please log in to reply
92 replies to this topic

#1 Elcoo

Elcoo

    Private First Class

  • Members
  • 15 posts

Posted 09 March 2013 - 16:52

I have a little bit of experience concerning realtime graphics, shaders etc., so here is an approach I would take to render grass at long distances, or at least obscure soldiers smoother than with the current method.

So here is a soldier in prone position:
http://s1.directuplo...09/tmseoir6.jpg (307 kB)

Let's take a look at the soldiers alpha layer:
Posted Image

And now here is a grass alpha layer I quickly sketched in photoshop:
http://s1.directuplo...09/jp5ucqp4.jpg (210 kB)

Using pixelshaders and combining global and local texture coordinates, we could multiply the alpha layer of the soldier with the grass layer, resulting in this:
http://s1.directuplo...09/qvojajgf.jpg (155 kB)
http://s1.directuplo...09/uaklkkkf.jpg (266 kB)

Now let's place our little fellow on some terrain!
Looking through the scope, without the multiplied alpha...
http://s1.directuplo...09/wjyay4ch.jpg (565 kB)

... and here it is with the new alpha:
http://s1.directuplo...09/iyqh868j.jpg (564 kB)

Here's what it looks like without scope...
http://s7.directuplo...09/3hd3afbd.jpg (164 kB)

... and here with the describben technique:
http://s14.directupl...09/doxrq6q7.jpg (164 kB)

Of course I simplified everything, so it is understandable to hopefully everyone, but I know this is possible since the day pixel shaders were invented. The performance impact should be minimal, considering no additional geometry has to be rendered and it can be done entierly on the GPU. I don't know if something like this is planned, so I thought I'd just share my thoughts on it.
Cheers!

EDIT:

Thanks for all the comments, I made a feedback entry on the tracker, here's the link:

http://feedback.arma...iew.php?id=3505

(thx for the tip coulum)

Edited by Elcoo, 10 March 2013 - 01:12.


#2 tremanarch

tremanarch

    First Sergeant

  • Members
  • 914 posts

Posted 09 March 2013 - 17:48

I dont know what you mean - it already working this way. at least you cant really say if there is grass alpha or they blends into the texture....

Posted Image Posted Image

I think it works really perfect for prone

this is the way it looks when laying down on sand / stones

Posted Image Posted Image

maybe here the soldier is easier to see because he is sharp while texture is blurry... either the texture should have some sharp random noise (stones stuff) or the soldier should get blurry also in the distance

Edited by tremanarch, 09 March 2013 - 17:53.

Posted Image
. . . . .

#3 Elcoo

Elcoo

    Private First Class

  • Members
  • 15 posts

Posted 09 March 2013 - 17:54

The current technique lets soldiers sink into the ground for about 20cm, so that only parts of their bodies are shown. The thing is, that the transition between ground and soldier is not very smooth, and much more noticable for the eye than a smooth transition. Of course this is still better than no obscuring at all, but I think my describben technique might lead to better/smoother results.

#4 Gorbachev

Gorbachev

    Sergeant

  • Members
  • 143 posts

Posted 09 March 2013 - 17:57

The final picture is way too hard to spot the soldier, but I like what you're on to here. Better than the current implementation.

#5 DayGlow

DayGlow

    Master Gunnery Sergeant

  • Members
  • 1328 posts

Posted 09 March 2013 - 17:58

Wow, I like this idea, I wonder how much more resources it would take vs the current 'sink' solution?
"It takes a big man to admit when he is wrong...I'm not a big man." Chevy Chase, Fletch Lives

#6 tremanarch

tremanarch

    First Sergeant

  • Members
  • 914 posts

Posted 09 March 2013 - 18:00

here is a closer version of the actual style

Posted Image Posted Image Posted Image


some alpha blend into texture would be enough. what stands out is the sharp vector edges and AA of the soldier model vs the blurry texture.
Posted Image
. . . . .

#7 DayGlow

DayGlow

    Master Gunnery Sergeant

  • Members
  • 1328 posts

Posted 09 March 2013 - 18:00

The final picture is way too hard to spot the soldier, but I like what you're on to here. Better than the current implementation.


Thats the idea behind camouflage. Now if the soldier is moving then you would be able to see the movement.
"It takes a big man to admit when he is wrong...I'm not a big man." Chevy Chase, Fletch Lives

#8 Minoza

Minoza

    Master Sergeant

  • Members
  • 798 posts

Posted 09 March 2013 - 18:01

I like your idea. I say why not try and give feedback? Could you make an addon maybe?

#9 tremanarch

tremanarch

    First Sergeant

  • Members
  • 914 posts

Posted 09 March 2013 - 18:02

in my eyes the real problem is not the fade between object and texture, but between visual qualits difference between object and texture.
Posted Image
. . . . .

#10 Elcoo

Elcoo

    Private First Class

  • Members
  • 15 posts

Posted 09 March 2013 - 18:03

Wow, I like this idea, I wonder how much more resources it would take vs the current 'sink' solution?

As I said, the performance impact should be minimal. The soldiers already use complex pixel shaders to render normal, diffuse and specular maps; alpha blending shouldn't be a great deal. The hardest thing would probably be to get the z-order right, so that it blends correctly with foliage near to the eye, but even this should be well solveable.

edit:
@Tremanarch: You're right, alpha blending is missing, so that the edges fade in better, but in the end this is more or less what I described.
@Minoza: I didn't give feedback yet, as I thought it would be easier to explain what I mean in a forum, because of all the pictures etc.

Edited by Elcoo, 09 March 2013 - 18:07.


#11 oldy41

oldy41

    Staff Sergeant

  • Members
  • 314 posts

Posted 09 March 2013 - 18:07

Elcoo, great idea.
Imho the results of the method proposed by you are much more promising than the solution currently implemented.
I always considered the effects of camouflage one of the graphical aspects crucial to game play and immersion. I would highly appreciate, if it could be improved.

#12 -Coulum-

-Coulum-

    Sergeant Major

  • Members
  • 1761 posts

Posted 09 March 2013 - 18:22

This is a far better solution than the current "sinking". For one it more accurately shows what is exposed of the soldier and second it doesn't mess with the hit detection (right now you actually have to aim above a sunken soldier to hit I believe). If it could be made into an addon it would be great. If BIS were to take up on it then even better. Either way, there needs to be better representation of grass/foliage at a distance.
Plus if this was combined with some better mid range ground textures... it would be a real step up for the series in this department.

#13 ghostnineone

ghostnineone

    Staff Sergeant

  • Members
  • 280 posts

Posted 09 March 2013 - 18:42

I can barely see them now as is! However, I find the sinking to be very stupid looking, so I would actually prefer this. If only it could stop the AI from seeing me...

#14 -Coulum-

-Coulum-

    Sergeant Major

  • Members
  • 1761 posts

Posted 09 March 2013 - 19:06

I can barely see them now as is! However, I find the sinking to be very stupid looking, so I would actually prefer this. If only it could stop the AI from seeing me...

not to bring this offtopic, but trust me, the grass helps conceal you, even against ai. Just remember, they have scopes too.

I am interested though, is the OP's suggestion remotely possible to mod in?

#15 butter_milch

butter_milch

    Private

  • Members
  • 8 posts

Posted 09 March 2013 - 19:20

This is an excellent idea. Let's hope they implement it (shouldn't be too hard)!
Xfire | Intel i5 3570K | KFA² GTX 680 LTD OC V2 | ASRock Z77 Extreme6 | 8GB Corsair Vengeance LP 1600 CL9 | OCZ Vertex 2 E | WD RE4 1 TB | Corsair PS AX750W
Sysprofile
| Corsair H100 | Corsair Graphite 600T White | Asus Xonar Essence ST | BD DT 770 Pro | BenQ XL2420T | Cherry eVolution Stream XT | Razer Naga Hex

#16 aLmAnZo

aLmAnZo

    Gunnery Sergeant

  • Members
  • 419 posts

Posted 09 March 2013 - 19:23

Love it!
Spoiler

#17 ghostnineone

ghostnineone

    Staff Sergeant

  • Members
  • 280 posts

Posted 09 March 2013 - 19:29

not to bring this offtopic, but trust me, the grass helps conceal you, even against ai. Just remember, they have scopes too.

I am interested though, is the OP's suggestion remotely possible to mod in?


I've noticed plenty of xray ai

#18 dunedain

dunedain

    Gunnery Sergeant

  • Members
  • 579 posts

Posted 09 March 2013 - 19:34

Would be nice too if they put a slider, like for the shadows, to set how far the grass is rendered as well.

not to bring this offtopic, but trust me, the grass helps conceal you, even against ai. Just remember, they have scopes too.


I may be wrong but I do believe it's been proved over and over that on ArmAII only trees and bushes may provide concealment, not grass. As for ArmAIII, I remember some interview a while ago in which they said the issue wasn't likely to be fixed with ArmAIII. Considering the distances I've seen myself being engaged from by AIs, I think it's safe to say they still see you through grass.

I like OP's idea. It remains to be seen if it doesn't stands too much in movement though.

Edited by dunedain, 09 March 2013 - 19:43.


#19 Max Power

Max Power

    Mr. Angry Face

  • Members
  • 12828 posts

Posted 09 March 2013 - 19:57

I suggest everyone take a moment to read about "overdraw".

Would be nice too if they put a slider, like for the shadows, to set how far the grass is rendered as well.

I may be wrong but I do believe it's been proved over and over that on ArmAII only trees and bushes may provide concealment, not grass. As for ArmAIII, I remember some interview a while ago in which they said the issue wasn't likely to be fixed with ArmAIII. Considering the distances I've seen myself being engaged from by AIs, I think it's safe to say they still see you through grass.

I like OP's idea. It remains to be seen if it doesn't stands too much in movement though.


I cant' remember what game it was for, Arma or Arma2, but I remember the devs talking about a clutter approximation component to their detection system. So, if you're in clutter, it would modify their chance to detect you the same way crawling prone or other modifiers work.

Edited by Max Power, 09 March 2013 - 20:01.

Posted Image
Posted Image
My inbox is fill and won't be emptied. If your PM is regarding requests to use my work, unfortunately I choose not to grant such permission. My work is for use with CWR2 only.

#20 Harzach

Harzach

    Sergeant Major

  • Members
  • 1777 posts

Posted 09 March 2013 - 20:09

I cant' remember what game it was for, Arma or Arma2, but I remember the devs talking about a clutter approximation component to their detection system. So, if you're in clutter, it would modify their chance to detect you the same way crawling prone or other modifiers work.


Isn't that how the ACE AI Grass View Block module works? I'm not sure.

Anyway, great stuff, Elcoo!