[sharing is bang bang bang] Explody

Feb 23, 2012 at 12:30am

[sharing is bang bang bang] Explody

I had an idea recently to make a basic run-of-the-mill explosion effect in Jitter. Something like what you’d see in your favorite shoot em up bang bang video game. Originally, I wanted it to be a Jitter recipe, but as I dug into it, it started to get complicated. At this point, I just want to go ahead and share this as an exercise in going down the rabbit hole to make something cool. Included in this patch is a really handy geometry shader that takes a mesh of points and renders it as textured quads (great for particle fx), and a decent jit.gen implementation of basic particle physics. Hopefully the comments in the patch are enough of a roadmap for you to take it apart and have some fun too.

#61926
Feb 23, 2012 at 12:32am

Here’s the attachment. OOPS

Attachments:
  1. explody.zip
#223628
Feb 23, 2012 at 10:39am

sounds fantastic, but i get something like this :(

jit.gl.shader: — START GLSL INFO LOG: fp –

0(69) : error C7532: global type sampler2DRect requires “#version 140″ or later

0(69) : error C0000: … or #extension GL_ARB_texture_rectangle : enable

0(74) : error C7531: global function texture2DRect requires “#extension

GL_ARB_texture_rectangle : enable” before use

jit.gl.shader: — END GLSL INFO LOG: fp –

jit.gl.shader: GLSL program failed to compile.

ob3d_draw_preamble camera: GL Error: Invalid value

jit.gl.shader: — START GLSL INFO LOG: fp –

0(69) : error C7532: global type sampler2DRect requires “#version 140″ or later

0(69) : error C0000: … or #extension GL_ARB_texture_rectangle : enable

0(74) : error C7531: global function texture2DRect requires “#extension GL_ARB_texture_rectangle : enable” before use

jit.gl.shader: — END GLSL INFO LOG: fp –

jit.gl.shader: GLSL program failed to compile.

#223629
Feb 23, 2012 at 6:54pm

Sounds like your hardware might not have very good support for geometry shaders. It varies a great deal across different graphics cards. What sort of GPU do you have?

#223630
Feb 23, 2012 at 7:03pm

i am working on geforce 9600 gt.

#223631
Feb 23, 2012 at 8:02pm

Actually, on second look, those errors are coming from a fragment program (not the geometry program), and your card should be able to handle it. Do other jit.gl.slab/shader patches work on your machine? What version of Max? What operating system?

#223632
Feb 23, 2012 at 10:21pm

yes, the helpfile of jit.gl.slab is running great. i am using max 6 and windows 7 x64. thanks for interest :)

#223633
Feb 23, 2012 at 10:29pm

hi Andrew
same thing here , windows 7 x64 too, nvidia gtx 580…

#223634
Feb 24, 2012 at 12:38am

If you go into jitter-examples/render/Shaders/ and try the gm patches do those work too?

#223635
Feb 24, 2012 at 10:04am

hi,
yes same error on gm.videopoint;
gm.solidpoint.demo and gm.illumilines.maxpat work fine…

jit.gl.shader: — START GLSL INFO LOG: gp –
0(52) : error C7532: global type sampler2DRect requires “#version 140″ or later
0(52) : error C0000: … or #extension GL_ARB_texture_rectangle : enable
jit.gl.shader: — END GLSL INFO LOG: gp –
jit.gl.shader: GLSL program failed to compile.
ob3d_draw_preamble initial: GL Error: Invalid value
jit.gl.shader: — START GLSL INFO LOG: gp –
0(52) : error C7532: global type sampler2DRect requires “#version 140″ or later
0(52) : error C0000: … or #extension GL_ARB_texture_rectangle : enable
jit.gl.shader: — END GLSL INFO LOG: gp –
jit.gl.shader: GLSL program failed to compile.

#223636
Feb 24, 2012 at 10:54am

FWIW

Works for me with a Geforce 9600M GT and Max 6, but I’m on OSX.

Neato, thanks!

#223637
Feb 24, 2012 at 8:41pm

Thanks to matmat, I think I’ve got a fixed shader for those of you on Windows 7 who are having trouble.

Attachments:
  1. ab.gmquads2.jxs
#223638
Feb 26, 2012 at 11:31pm

Thank you, great stuff!

PS: I had to update to Max 6.0.4., gen didn’t compiled in 6.0.3.

#223639
Feb 27, 2012 at 12:17am

the ab.gmquads2.jxs shader is really awesome! i wonder if there is any way to individually rotate the images? like you can individually set the opacity of each image…

#223640
Feb 27, 2012 at 11:44pm

It’s possible to encode the rotation information into one of the unused GL attributes, like normals or something, and then read that inside the vertex program and pass to the geometry shader for transforming the generated quad points. that was a little more effort than I cared to bother with for this particular thing. Alternately, you could do the whole deal with jit.gl.multiple and do all sorts of other things.

#223641
Feb 29, 2012 at 9:33am

here an another basic explosion with physics….

– Pasted Max Patch, click to expand. –
#223642
Feb 29, 2012 at 10:32am

with Text3d :

– Pasted Max Patch, click to expand. –
#223643
Feb 29, 2012 at 11:28am

Hey Andrew,

Thank you for your patch. Unfortunately it gives me the errors below. I am on a Macbook Pro 2.8GHz, NVIDIA GeForce 9600M GT 512 MB. I tried both versions of jxs file.

class noise does not work in gen domain jit.gen
class concat does not work in gen domain jit.gen
jit.gl.shader: — START GLSL INFO LOG: fp –
ERROR: 0:65: ” : #version must occur before any other statement in the program
jit.gl.shader: — END GLSL INFO LOG: fp –
jit.gl.shader: GLSL program failed to compile.
jit.gl.shader: — START GLSL INFO LOG: fp –
ERROR: 0:65: ” : #version must occur before any other statement in the program
jit.gl.shader: — END GLSL INFO LOG: fp –
jit.gl.shader: GLSL program failed to compile.
name blip01 already in use. ob3d does not allow multiple bindings
class noise does not work in gen domain jit.gen
class concat does not work in gen domain jit.gen
jit.window: object with name thisguy already exists, generating a unique name
jit.gl.shader: — START GLSL INFO LOG: fp –
ERROR: 0:65: ” : #version must occur before any other statement in the program
jit.gl.shader: — END GLSL INFO LOG: fp –
jit.gl.shader: GLSL program failed to compile.

#223644
Feb 29, 2012 at 5:32pm

Not sure what’s up with the shader errors, but it sounds like you have an older version of Max 6. Go update to 6.0.4 and those gen errors should go away.

#223645
Mar 11, 2012 at 5:49am

Hi thanks,

that’s nice.
One question: If I want to make a “flame” or “fire” that can be animated (getting small, large…) I should take a “flame shader” as a starting point and bring it into jxs format, right? That’s the easiest way? Or should I start to build something with particles within jitter? Or export an animation-file from blender or similiar software and then animate it?

#223646

You must be logged in to reply to this topic.