Grass Has A Soul

Blitz3D Forums/Blitz3D Programming/Grass Has A Soul

Omnicode(Posted 2015) [#1]
Hello,
Recently I've been putting together a small demo that utilizes a very cheap way to place grass in varying densities around the camera. The closest obviously being the MOST dense and further away being lesser of the sort. My routine places them correctly, however, there seems to be a 'ghost' of the object traversing from the origin to the intended location upon "showentity" being called, as I initially "hideentity" when it's being copied from the master prop.

Is this a sort of tweening issue associated with "moveentity"?

The 'ghost' entity only appears for an instant when "showentity" is called regardless of the duration between the object's creation and being displayed.




Omnicode(Posted 2015) [#2]
Update/Fixed Sorta.

By putting these functions before the "captureworld" call within the main loop it eliminates the 'ghosts'

If anyone's interested in the demo, leave a comment asking. Way easier to understand than some of those other demos out there.


Rick Nasher(Posted 2015) [#3]
Sure. Please do. Love to see it in action.


stayne(Posted 2015) [#4]
I'm interested. How are you placing the grass on the terrain? Via grassmap image hopefully?


Guy Fawkes(Posted 2015) [#5]
Yes, could you please show us a small demo example? Maybe of like a forest with grass & fog or something? (And not that z-order grass demo, cuz' that one is completely outdated).


Omnicode(Posted 2015) [#6]
It's nothing too fancy. Just a simple effect that can be optimized most likely.

https://www.mediafire.com/?7rbdm6xz2mseur6


Rick Nasher(Posted 2015) [#7]
Thanks for sharing. Indeed very basic, but also easy to see through for beginners. I like the way you assembled the "Quad" model. Like that it's way more difficult to spot the "x"'s and makes it look more natural and random.

I see you also have some wind variables in there. Did you manage to get a convincing wind effect on the patches or still working on it?


Omnicode(Posted 2015) [#8]
No Problem,
I hope to make this simple system very powerful over time.

The "Quad" model is reminiscent of an earlier project from last year and It works quite well if anyone feels they need to use it in their own projects.

At one point I was playing around with some wind variables but I cleared them before submitting as they weren't complete.

If you hit space bar within the program most of how the system works becomes apparent.

Plan on allowing the grass to align to the terrain, wind, and more density tweaks.

The "grass z-order" example always seemed too flushed for a beginner to really grasp, I hope to make an example that is easier and more compact to read and understand.


Rick Nasher(Posted 2015) [#9]
I was well on my way producing a foliage system based on Matt Merkulov code idea and added a grassmap system, but FPS and some other restrictions were killing it: http://www.blitzbasic.com/Community/posts.php?topic=102163

However this Blitz Forest holds much promise:
http://www.blitzbasic.com/codearcs/codearcs.php?code=949#comments


Omnicode(Posted 2015) [#10]
I'll make sure to post any 'breakthroughs' in my tinkering. I believe I need only make placement more dynamic to the camera.

My thought process is a slight twist to the concept I used before.

Base "Nodes" placed within a given view+general radius that will spawn grass at a density that will increase with the lessening of distance between them and the camera. However the "Nodes" will not be parented to the camera, they will naturally cycle about the camera based on their maximum distance. i.e

-> Fill viewport and surrounding area with a certain amount of nodes, prioritize viewport > surrounding area, nodes will spawn given amount of grass_props based on their variable of distance to the camera.

-> At each node that is outside of surrounding area range but within view only have 1 or 2 grass_props to define where the node is placed.

-> Have additional grass_props phase in via alpha# and slight delta'ing from the position of the 1 or 2 to its intended location (offset from the 1 or 2) So there's a nice fade-in duplication sequence when rendering far away grasses. Also prevents any 'pop-up' artifacts close up.

-> System will allow for individual manipulation of the array'd grass_props only by accessing the base node. Nodes only 'activated' within viewport.





Rick Nasher(Posted 2015) [#11]
Interesting approach. Curious to see how will work out.