Gejigeji - .scr using accumulation transform in mesh gen.

Post screenshots, binaries and projectfiles of the projects you have made with ZGE that you want to share!

Moderator: Moderators

Post Reply
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Gejigeji - .scr using accumulation transform in mesh gen.

Post by jph_wacheski »

This is just a little .scr,. but nice looking and in 3d. it grew out of some prelimenare testing of the new transform accumulation mesh building (in the beta).

Each segement is 128 cubes X2 there are 30 of them,. so close to a hunderd thousand polys,. and rendered with alpha using alpha/one and the back faces on,. it runs fine on this machine.

Gejigeji is the japanese name for those soft shelled house centapedes,. see;

http://www.flickr.com/photos/skipthefiller/2331559/

they keep me company,. when working down in the dungon.


peace
Attachments
Gejigeji__003.zip
.scr art/demo
(46.1 KiB) Downloaded 687 times
iterationGAMES.com
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Now in Color and featuring Sounds! some sort of ambiant-drone generated music,. . plus some other tweeks,. . I'm done with it for a bit, gotta' get back to building games.

EDIT: seems ZGE disables sound for .scr builds? anyway here is a .exe w/ the sounds..,
Attachments
Gejigeji__005sound.zip
the .exe w/ sounds
(45.4 KiB) Downloaded 673 times
screen still,.
screen still,.
Gejigeji_still_detail.jpg (50.51 KiB) Viewed 17559 times
Gejigeji__005sound.zip
the .scr file itself,.
(46.54 KiB) Downloaded 678 times
iterationGAMES.com
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Nice ~

But I wonder if it would look better with a closed mesh .. it's not that difficult really. Instead of a cube, first use a rectangle and store the coordinates for each vertex in a 3D Array. The first dimension is the pass ( size is number of loops ), second the vertex ( size is 4, one slot for each vertex of the rectangle ), and third the coordinate ( X+Y+Z makes 3 ). Then use another 2D rectangle mesh with a edge count of the first and second ( 4 ) dimensions, to recreate the shape using the sampled coordinates out of a single solid mesh.

K
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

I kinda like the over renderers,. but that could be done in a closed mesh as well, I guess. That sorta 3d math drives me nuts,. if you want to post a working sample I will adapt it to this,. . thanks.

Ville- I notice if you set the vertex colours on the mesh the material color seems to have no effect, it that right? I just wanted to try fading the mesh (m_mesh.color.a) in place of the screen flashes when the mesh is regenerated.., no go. This works too.
iterationGAMES.com
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hey jph,

No math ( that's what the MeshTransform is for ) .. just logic. Although I still recommend calculating it yourself obviously, since with this method you're constructing the "same" mesh twice .. once "open" using MeshTransform, and another time "solid" from a single mesh. Anyway, attached is a basic example.

+ You can always use a shader to mix the vertex colors with a alpha value.

Code: Select all

varying vec4 vertex;

void main()
{
  vertex = gl_Color; // gl_Color isn't passed automatically somehow, so we pass the value manually.
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; // ftransform() is obsolete since GLSL 1.4
}

Code: Select all

uniform float alpha; // Neither is gl_FrontColor to the Vertex Shader, so again a manual pass.
varying vec4 vertex;

void main()
{
  gl_FragColor = vec4(vertex.r, vertex.g, vertex.b, alpha);
}
K
Attachments
Solid.zgeproj
(3.25 KiB) Downloaded 671 times
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

ah,. I get you now! we shoot the quad along the curve and then build the mesh off the corners,. you are so cleaver. yup no trig. the accumulator does it for me! thanks Kj :)

I got it working with my painting,. and of course I did some more tweeking, compulsive that. Anyway, attached is the new ver. However I did get a bunch more ideas while doing this, so perhaps not the last ver.

I will get to trying some of your shader codes soon, I hope. thanks for those too.

oh Kj what happens to the quads? does the mesh rebuild override them? I can still see them in the preview on one side of my mesh (I add a transform to get two sided curves) and I could at first in the build ver,. but some hacking around and they dont appear,. not sure how though,.

also; Ville the preview of meshes is a bit off from the runner,. this mesh only show in wireframe and as i say with the quads that don't show in the run ver,. also the colors are often different between the two,. could just be an updating issue,. if i can track it done better i will bost a bug,. .
Attachments
Gejigeji__007.zip
.exe with sounds,. .
(45.66 KiB) Downloaded 671 times
Last edited by jph_wacheski on Thu Jul 23, 2009 3:58 pm, edited 1 time in total.
iterationGAMES.com
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi jph,

I didn't put a MeshCombine behind my final "solid" mesh, so the previous rectangles are flushed. But I guess if you need multiple "strands" in a single mesh you probably want to use a seperate mesh from which you do the MeshTransform / sampling, and another mesh in which all the solids are combined.

K
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

ah yes, I found that and removed it cool,. thanks.

here is another ver.,. largly the same, but a bit different too,. . it's fun to work with these vertex colors,. no textures needed. think I will try to build something less abstract now,. .
Attachments
Gejigeji__009.zip
.exe w/noises
(45.96 KiB) Downloaded 674 times
iterationGAMES.com
Post Reply