Forums > Jitter

[sharing is bang bang bang] Explody

February 23, 2012 | 12:30 am

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.


February 23, 2012 | 12:32 am

Here’s the attachment. OOPS

Attachments:
  1. explody.zip

February 23, 2012 | 10:39 am

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.


February 23, 2012 | 6:54 pm

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?


February 23, 2012 | 7:03 pm

i am working on geforce 9600 gt.


February 23, 2012 | 8:02 pm

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?


February 23, 2012 | 10:21 pm

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


February 23, 2012 | 10:29 pm

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


February 24, 2012 | 12:38 am

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


February 24, 2012 | 10:04 am

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.


February 24, 2012 | 10:54 am

FWIW

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

Neato, thanks!


February 24, 2012 | 8:41 pm

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


t
February 26, 2012 | 11:31 pm

Thank you, great stuff!

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



t
February 27, 2012 | 12:17 am

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…


February 27, 2012 | 11:44 pm

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.


February 29, 2012 | 9:33 am

here an another basic explosion with physics….

– Pasted Max Patch, click to expand. –

February 29, 2012 | 10:32 am

with Text3d :

– Pasted Max Patch, click to expand. –

February 29, 2012 | 11:28 am

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.


February 29, 2012 | 5:32 pm

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.


March 11, 2012 | 5:49 am

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?


Viewing 20 posts - 1 through 20 (of 20 total)