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?
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
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?
May be there is some way of creating a material so an object can "produce" light affecting it’s surrounding?
Thanks for your patience :)
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.
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. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 2181.3oc6cssbaiiD8Y4uBTrlGl3nQCwEdQ6T6TdlW1WlOfsp3TpnEgkPVJR sjP1Nap7uu3BIMokDEDsMkTFTtrUL.HPiCZznOMa37sqF4bW1SzBGv+.7Ivn Qe6pQiTEIKXT4uOxYUzSyShJTMyIk9X1cewYrtJN8Itp3jrn3UzhB.bhWUko aVksgmP4pmDVV55H97krzEyxoy45QFhm3NFfc8jeDhj+D4NwE74xGgEqFCw3 9Kd0898Yo7znUTUU+QNKJopF8fx+5Zpt6cbp6I4CUv9epJfxApVR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8MzzHGbGPcH6Qu4PCJ5KCgWPWfheeAE wVBsrcJcK4QVZb1iB29XBQDbqy+R9er.+YTRxsN8DyJy8Nn2zN+KO+q.0N09 wkKIJj2W3Qeda2VaIWpnS1ZvMhu+80u9+PIT5uFty2DF9x8OTBR3JMiUHYBL eYTNf3BHt8Etz4+KD0cVcdBOCW8fsCGiF7dYHBJgvsClQKN+6It.xLDuQi1J n.aGPfsVLMUdlZf3DLXRSfARi+fIM9FHMjAUZfmMRiGz.vAObxCwj8UDzvIO DSjG3vIOXSjGuyL4Y.0ePmYqWma6ubMPdfC24VXiNGc3DGS1tCGtCRwlr8B6 NbxiwpyvgSdfmQ3iIVeFNwAYhaguvD9IWdPAmYxyv4oJxDGmQC35kItNCCGN 4Aed4cnINaLbqVPSzlwmYxCb3rF9BE0S9tKnITAGPewfmY61MCeFP8GS7UEN f5OmYNGZj7LjqWn2QtEfOe02u5+yBSnk. -----------end_max5_patcher-----------
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 ;))
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!
Look at the multi.lights.material.maxpat in examples>jitter-examples>render>lights.material for the example
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.
Awesome, thanks Rob
Forums > Jitter