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

Oct 27, 2011 at 2:59pm

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

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

If not, is there some way instantiate lights?

Thanks!

#59593
Oct 27, 2011 at 5:10pm

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/

#214470
Oct 27, 2011 at 5:47pm

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 :)

#214471
Oct 27, 2011 at 6:50pm

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

#214472
Oct 27, 2011 at 7:36pm

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. –
#214473
Oct 27, 2011 at 8:41pm

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 ;))

#214474
Oct 31, 2011 at 2:08pm

#214475
Apr 19, 2012 at 12:04pm

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!

#214476
Apr 19, 2012 at 1:32pm

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

#214477
Apr 22, 2012 at 11:26am

Ah, thanks!

#214478
Apr 22, 2012 at 6:10pm

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.

#214479
Apr 22, 2012 at 7:21pm

Awesome, thanks Rob

#214480

You must be logged in to reply to this topic.