Shell Texturing Geometry Shader [multiple examples]

This is something that I experimented with yesterday, shell texturing…

Shell texturing involves creating mesh layers, then using one or more alpha textures to create the effect of volume. Looks quite good for rendering fur, and can look descent for grass as well. If you want to learn more, you can check out this site: http://www.xbdev.net/directx3dx/specialX/Fur/

It didn’t quite turn out to fit my project, but I thought others might be able to profit for my experiment. So, I am posting it here.

Sorry the video quality is not all that great. With all the movement it was making gigantic files (~3.4 Mb per sec @ 1080p - kinda crazy).

As with my last geometry shader, it has only been tested on Nvidia. I do not know if it will work on Intel/AMD. If it does work let me know; however, I suspect that it will not.

EDIT: It might work for AMD after all…

EDIT: Mesh was already triangulated, this is why it was working for AMD…

geoShellTex.blend (1.09 MB)

You can specify how many layers you want to create in the geometry shader, but don’t forget to change the max_vertices as well…
It also includes a very basic lighting model.

Controls:
-uses blender’s internal mouse look
-Q/E keys rotate left/right around the center of the plane
-W/S keys raise/lower the light position
***
Sphere/Clouds

This one creates duplicate sphere shells to simulate stylized clouds around a planet. The clouds move, form, and dissipate…

EDIT: Update 1.1 - triangulated the mesh for AMD/ATI support

geoShellTex_Sphere-Clouds1-1.blend (465 KB)

Controls are listed in the readme and are pretty much the same as the grass example…

1 Like

It looks great.And the computer i use has amd.
The framerate i get 36.And it fluctuates in the thirities for framerate.

Really cool! Keep up the good job!

i get a slight lag for about 3 or 4 secs then a smooth 60fps. GPULat at .02 and ras at .09…the initial spike is in logic till the timer reaches about 3. After that 60 fps all the way on old dualcore 2.66ghz, 4 gig ram, nvidia 9400gt, win7-32, and b2.74. Nice job. My only critique would be that the grass tends to swirl rather than wave.

My Alienware Alpha 60 fps all the way,
I need to look at % , ms etc. later.

No go for Intel HD4000.

Doesn’t work for my current native x.org linux drivers on gt 610!

Nice one!
What if I have an atlas texture and I want a different piece of texture for every layer? Also want it to be visible on both sides…
Can it be done with spheres?

Thank you,
You can have different textures for different layers; however, the shader is not currently setup for this. There would have to be additional coding added for each layer specifying what texture to use. (i.e. if (i == 0) use texture1, if (i == 1) use texture2, etc.)

Also want it to be visible on both sides…

Yes; under ‘Game Settings’ in the material panel, uncheck ‘Backface culling’

Can it be done with spheres?

This technique can be applied to spheres, but again, changes to the shader would have to be done. The current coding adds a duplicate of the original object and offsets it along the +Z axis. Instead, it would need to offset each vertex by a multiple of the original position (in object space).

Yes; under ‘Game Settings’ in the material panel, uncheck ‘Backface culling’

Oh, so you actually replicate the a plane instead of generating one?

You can have different textures for different layers; however, the shader is not currently setup for this. There would have to be additional coding added for each layer specifying what texture to use. (i.e. if (i == 0) use texture1, if (i == 1) use texture2, etc.)

Hmm, I see, I ask for a single texture, or a texture mosaic! So there should be an UV displacement or something… You mean you’re done with it. It looks cool, but I see so much potential!

In any case, thank you very much for this resource!

Great work!

Added an example for creating sphere shells…

Creates sphere shells to simulate stylized volumetric clouds around a planet…

Seems the Textures are missing in geoShellTex_Sphere-Clouds1.blend.

Very cool indeed!
I guess that one can even skip the texture and use noise alpha. Clouds generally don’t need much color info. My guess is that this way we can have much higher resolution, realistic clouds.

BTW, this could turn into a good particles generator. Where one could spawn all sorts of meshes or sprites, I’m not sure about pixels, without costing too much!
The spherical cloud system costs a lot to render if CPU calculated or manually made!
Great work! If you keep going, this will evolve into a beautiful setup!

Sorry about that; I re-uploaded the blend, textures are now packed…

The grass looks really awesome, but for some reason it’s completely black in my project. Everything is normal in the demo .blend file though…

Updated the clouds example.

HG1 found the problem with my shaders for AMD. The meshes need to be triangulated for those systems. The grass example was already triangulated (which is why it was working for those systems), I updated the clouds example so that it would work on AMD/ATI cards. The code did not change, only the mesh…

This looks very nice;)

Necroing this old post.

Has anyone had an opportunity to recreate this shell based shader system to offset geo, similar to @Yarbrough08’s cloud shader?

haha, im looking for the same thing, would be sweet, i want to create a fur, that can be used in lets say vrchat, as the particles wont work… also, animations would render faster.