Home Artists Posts Import Register

Content

Last night's experiments diverted from plant generation pretty quickly, so we gave it another go today using a model and texture created by Simon. This produced much better results!

Initialising Textures

The first step was to render a flat rectangular plane with a texture on it. This uncovered some bugs in the texture code I extracted from Sector's Edge, which produced some funky visuals:

After fixing the texture-loading code, I managed to create these little plants by rendering two planes in a cross pattern:

However the shadows were still flat rectangles, so the next step was to use the same fern texture in the shadow shader. Pretty!

Shaping and Bending

I said to Simon that it would be cool to try ferns next, and he informed me that that's what this texture was for, you doofus!

To create curved ferns, the rectangular plane has to be bent, like this:

Source: Wikipedia

This is a new rendering technique for me and it involved much trial and error to get it right.

My first attempt warped space, time and reality:

My second attempt came close, but the plant curved too far and rendered above the ground:

I then recreated the Sydney Harbour Bridge:

After about 2 hours of not understanding maths, it finally bent correctly. I changed the texture here as a debugging aid, where white represents full bend and black represents no bend.

The final step was to add more ferns at different rotations.

More full-res screenshots and a video of it blowing in the wind are available here.

Tomorrow's post will feature more plants, as I'm now confident in this rendering method!

Files

Comments

Anonymous

> However the shadows were still flat rectangles, so the next step was to use the same fern texture in the shadow shader. Pretty! Genius! Plants often look pretty bad in games, even from AAA studios - but those look really good!