Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Low poly plants with the use of planes? Not possible in AGK?

Author
Message
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 19th Mar 2018 15:43
I have tried to follow a couple different tutorials in blender of making plants with just using planes. The problem is when I load them into AppGameKit, you can see the untextured parts of the plane. So its just showing an ugly green plane. Instead of some blades of grass. Any tips on this?
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 19th Mar 2018 15:55 Edited at: 19th Mar 2018 15:59
Sounds like you either need to set the transparency color to your image background color, or use alpha channel transparency instead

That said, sometimes it is better to just model out some low poly grass blades and skip the transparency. In some cases, you don't add that many more triangles and you save yourself a bunch of overdraw. Its a balance, and situations vary /shrug
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 19th Mar 2018 16:10
Yeah, you need to set transparency for the object to mode 1.

https://youtu.be/HK6J6oqim14
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 19th Mar 2018 16:29
Thank you so much, Ortu. I used setobjectalphamask, and it worked perfectly!
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 20th Mar 2018 00:43 Edited at: 20th Mar 2018 00:59
Sorry, I found a bad view... If the camera is directly above the grass I just see it from top down. I tried to use atan2() to force it to face the camera, but I guess I need stronger math to force it to turn on the y axis.
bad


good

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 9th May 2018 05:44 Edited at: 9th May 2018 05:49
Not sure how you are making your plants

but the simplest way to make low poly plants with polys would be to use something like 5 upright planes
that cross at the centre these planes would need to have textures on either side and transparency. This is
how many things are made in games such as secondlife.

The problem arises when you look from a different view ie above this can be rectified with some more planes
but not really recommended as the more planes you use to create one it then becomes maybe better to have
used a mesh in the first in the first place

There is a thread somewhere that also has wavy grass using a shader
not sure where that thread is at the moment but I believe Batvink supplied a source
https://forum.thegamecreators.com/thread/215529
fubar
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th May 2018 07:30
I found the source, but I didn't create it
Shaders are still a mystery to me.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th May 2018 07:48
Single plane foliage is only really good for when you want an insane amount of foliage, like to blank out the terrain pretty much. DX11 can take point data and render it as flat planes, which provides an insane amount of foliage at a decent frame rate. I'd love to see something like that in AppGameKit, where you can just use the vertex shader to define the plain mesh. I'm not sure that AppGameKit is ideal for processing thousands of objects, certainly not if you have to step through them for whatever reason.

I prefer to use maybe 5 or 6 polygons per grass 'clump' instead, and bend them vertices so it looks better from above. Like, if you have a plane, and split it halfway up and bend it forward a little, it's doubled the number of polygons but allows for more variation. I'd make a few variations of the plant mesh and combine them into bushes and patches of grass. I also try and make the mesh fit the shape of the grass better, don't just use square plains, get a general outline instead so you aren't rendering too much redundant alpha 0 pixels.
The code is dark and full of errors
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 9th May 2018 11:01
Look at far cry 5, they did the same, but they have what appears to be a fifth plane at an angle to the others.....picture it laying down almost flat. Thats covers looking from above.

They also use plants made of 4 planes and a triangle. I plan to implement both in my own work here.
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 9th May 2018 11:09
Perfectly possible though.

https://youtu.be/iqgW4PxDqMI
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 14th May 2018 14:21
I'm not convinced that FC5 uses cross plains... there's a helluva lot more polygons used than that. I'm sure the typical workflow for Farcry is to make high poly plant models and render them to flat polygons, then use a shedload of them to make thick grass clumps. For one thing, they sway in the wind nicely, which is something quite tricky to achieve with less polygons. Also... they look better than typical cross plain foliage.
The code is dark and full of errors
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 14th May 2018 18:14
I think they use a mixed method but the def do, I've got the game and spent a good amount of time staring at my feet lol. The angle some at 45 degrees to take away the square look.

The attached shows it but I'll try getting a good screen grab later

Attachments

Login to view attachments
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 14th May 2018 20:36
I think the grass uses a lot of flat plains, but damn there's a lot of detail in some of the foliage - especially the flowers. You can certainly recrate grass with plains, and the more plains you use the better it'll look - but bushes and taller grass will benefit from a more considered approach. I've been playing FC5 a lot, damn good game
The code is dark and full of errors
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 14th May 2018 21:10
Yeah, the tall plants seem to be four angled planes on a triangle.....I'm exploring that myself. You can simulate movement by using uv coords to identify where the vertex is. It's not that hard actually.

Yeah, it's ok....but it's basically the last three far cry games with planes. Have you seen the far cry 4 graphics comparisons? In many places 5 clearly got a downgrade, probably to allow more detail somewhere else.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 15th May 2018 15:31
Yeah, it becomes more apparent if you experiment with the level editor... always a good idea for anyone writing terrain systems, editors, shaders... lots of inspiration. Anyway, I agree, they have really cut back on some details. One thing that annoys me is the lacklustre terrain system - technically its all good, uses tessellation, but the ham-fisted procedural textures are a bit of a letdown - they repeat quite obviously, and there's a limit of 4 textures... I mean... we can both probably understand that, if they're using vertex colouring for texture assignment then that makes perfect sense... but its also weak as hell, and ourselves we wouldn't settle for that. I'd guess that its a limit for the whole game, except we can't assign different textures to different terrain mesh chunks. I'm guessing they reduced the polygon spend so they can have a longer view range and a shedload of foliage... they probably knew they'd be filling corn fields and meadows and farms... so they cut the budget right down.
The code is dark and full of errors
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 15th May 2018 23:16
There's no doubting that it ehlps to have awesome artists too. It does still look good, but it's really still relying on old techniques.

Quote: "they repeat quite obviously, and there's a limit of 4 textures... I mean... we can both probably understand that, if they're using vertex colouring for texture assignment then that makes perfect sense... but its also weak as hell, and ourselves we wouldn't settle for that. I'd guess that its a limit for the whole game, except we can't assign different textures to different terrain mesh chunks."


Not sure I follow here - my terrain uses an atlas so you can have as many textures as you wanted - I settled for 16. You can also easily assign a new texture set to each chunk if you so wished - when I fully build my landscape example it will have different zones with different texture sets.

As an aside, I had a to do outstanding to improve my grass, which I have done. This image shows a slight modification, but now grass is drawn using an atlas. Here I have 8 distinct types, but I could have 100 if I so woshed, and the random chance of any one type is controllable. So in the realworld I could assign a grass image to each step of green in the color channel and manually, accurately place the type of grass for up to 256 different images, and if you wanted to be SUPER EXTREME you could then do that for each channel. I've settled for random mixing based on % chances, so will probably build somehting in that allows "chance zones" to be drawn....so types X,Y and Z can be set to be more likely near water for example.

The shading needs work but it looks more natural and "wild" compared to the single image version.

Again.....all grass is one single mesh so it's really quite fast to render.

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 15th May 2018 23:35
Its actually quite easy

- create a 100,000 memblock

- add color attribute to them

- change the Y vertices of every vertice of varying lengths (height)

- change that color of that vertex to a random shade of green

do

- if require windspeed in an your app - then change the X and Z on a small movement sin/cos on the tip of the vertex

- set the memblock

loop


Done!!!
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 16th May 2018 00:28
Puzzler, colour isn't relevant at all, what your changing is the uv coords of each plane. It's exactly what I said you'd need to do in the Minecraft thread, but beyond that it is the same principle. You also don't randomly set each y vertice, they need to match the ground. And the grass sway you'll never do at speed outside of a shader.
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 16th May 2018 04:14 Edited at: 16th May 2018 04:14
You guys took this way beyond what I was asking, and I appreciate it! I am going for something definitely more low poly and less resources. But now I do want to add the grass swaying. I settled on this grass, which has been working on all angles.

Attachments

Login to view attachments
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 16th May 2018 13:54
Yeah, it's easy to get carried away on these threads, especially when it's something you're actively doing yourself too. Lol. Sorry for high hacking.

The key is to find a solution for yourself and the target platforms. I write my code on a fairly decent rig powered by a GTX 1080, so I aim to keep my fps above about 300 to make sure it's mobile friendly....but that's not a market I have any interest in so I tend to lean more on higher complexity.

Love the little character btw.....would love to see video of this in action.

Login to post a reply

Server time is: 2024-04-20 03:08:44
Your offset time is: 2024-04-20 03:08:44