Forums > Jitter

instantiating jit.gl.lights with jit.gl.multiple?

October 27, 2011 | 2:59 pm

Is it possible to instantiate jit.gl.lights with jit.gl.multiple?

If not, is there some way instantiate lights?

Thanks!


October 27, 2011 | 5:10 pm

A light is instantiated by creating a jit.gl.light object. If you create several jit.gl.light objects, you will have several lights in your scene. jit.gl.multiple works by manipulating an existing object and changing its properties repeatedly to effect different visual results. This works for geometry because you can draw the same shape in many places, but for lights, which are operating ont he scene as a whole, it doesn’t make sense. For something like this we would probably need a jit.gl.lightmultiple object that was itself a light controlling several lights.

For an example of multiple lights in action, see the Jitter sneak peak video at around 2:12

http://cycling74.com/2011/10/12/max-6-sneak-peek-jitter-opengl/


October 27, 2011 | 5:47 pm

Hi Wesley,

I’m working on an array of colored objects and I want to attach a light to each single object so it will look like each object is producing light, this array is generated procedurally using jit.gl.multiple, it could change dinamically from one object to dozens, so in need a way to create and control multiple lights dynamically as jit.gl.multiple does.

I understand your point about light as a whole on a standard 3d scenario, anyway is there some way to create multiple lights procedurally?

Any idea that doesn’t involves Javascript?

May be there is some way of creating a material so an object can "produce" light affecting it’s surrounding?

Thanks for your patience :)


October 27, 2011 | 6:50 pm

With the way lights are currently implemented in Max6, you’re going to max out at 8 lights. Also, the more lights, the more performance is going to suffer. 8 lights fullscreen can be slow depending on your graphics card. The only way around this problem is with deferred shading, which is not how Jitter is architected right now.

Instead, I think your best bet is to fake it and figure out some way to give the illusion of light emission. Most games do this with a glow effect. Glow effects are essentially selectively applied blurs.

http://www.gamasutra.com/view/feature/2107/realtime_glow.php


October 27, 2011 | 7:36 pm

Here’s quick stab making a glow effect that actually works pretty well. I’ve used jit.gl.node to capture geometry to texture and jit.gl.pix to write the different parts of the glow effect:

– Pasted Max Patch, click to expand. –

October 27, 2011 | 8:41 pm

Got it! terrific example, thanks a lot!

(By the way, cycling74 should change the header and footer of the compressed code from "max5_patcher" to "max6_patcher ;))


October 31, 2011 | 2:08 pm


April 19, 2012 | 12:04 pm

It would be cool if Rob Ramirez would post his example patches for the sneak peak jitter OpenGL stuff. had a go at creating the lights patch but of course I cant see what’s going on in his p viz-light sub patches!


April 19, 2012 | 1:32 pm

Look at the multi.lights.material.maxpat in examples>jitter-examples>render>lights.material for the example


April 22, 2012 | 11:26 am

Ah, thanks!


April 22, 2012 | 6:10 pm

yup, that’s the one.
if there are any other patches from that video you’d like to see, let me know and i’ll try and dig em up.


April 22, 2012 | 7:21 pm

Awesome, thanks Rob


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