OpenGL Lighting questions.

Feb 16, 2006 at 5:01am

OpenGL Lighting questions.

Quick Question here

perhaps Ive grossly missed something (very possible), but the only
lighting control ive seen is with the jit.gl.render lighting
attributes, which seems to only apply to the ‘world light’.

how does one create other lights, beside explicitly sending openGL
commands to jit.gl.sketch?

small feature request (?) – perhaps a jit.gl.light with some options
for spotlights (radius, direction, intensity, spread, etc?) Ive just
gotten into getting heavy with lighting on jit.gl.render, and man it
adds so much flavor to a scene when lighting is dynamic. it would be
great to have a jitter object to mix it up some more.

Just a thought.

Also, small note re lighting in general, in the tutorial patch,
mat_ambient, mat_diffuse and mat_specular to the jit.gl.gridshape and
light_ambient, light_diffuse and light_specular to jit.gl.render are
all being sent as a list of 3 floats, (RGB), however when control-
option clicking jit.gl.gridshape & jit.gl.render, it lists their
input as float array[4]. Ive tried playing with the alpha component
to these messages in my own patches, but it only seems to effect
mat_specular, but that could be my imagination.

Comments/thoughts?

Thanks again.

v a d e //

http://www.vade.info
abstrakt.vade.info

I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I
LIVE! I LIVE! I LIVE! I LIVE!

You will not be saved by the Holy Ghost. You will not be saved by the
God Plutonium.

In fact, YOU WILL NOT BE SAVED!

#24451
Feb 16, 2006 at 5:07am

Apologies, I forgot to mentioned that the tutorial patch I am
referring to is 35jLightingAndFog.pat

thanks.

v a d e //

http://www.vade.info
abstrakt.vade.info

I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I
LIVE! I LIVE! I LIVE! I LIVE!

You will not be saved by the Holy Ghost. You will not be saved by the
God Plutonium.

In fact, YOU WILL NOT BE SAVED!

#70706
Feb 16, 2006 at 3:07pm

I second the question -

I’m working on a project where I’ve modeled a (.obj) vintage 50′s TV
screen. The model is working perfectly for creating a custom glass
warp distortion and mask, but the next level is to manipulate the
lighting to achieve reflection/glare/shading – no luck so far.

-deKam

#70707
Feb 16, 2006 at 4:34pm

I’m pretty sure you could write a shader to calculate “virtual light
sources” to get the effect you’re looking for. The gooch shader had
some nice specular highlights. May be a place to start.

wes

#70708
Feb 16, 2006 at 4:51pm

what would one bind the shader to, if you want to to effect the whole
scene?

comments re jit.gl.light request, or adding other lights sans writing
custom shaders?

v a d e //

http://www.vade.info
abstrakt.vade.info

I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I
LIVE! I LIVE! I LIVE! I LIVE!

You will not be saved by the Holy Ghost. You will not be saved by the
God Plutonium.

In fact, YOU WILL NOT BE SAVED!

#70709
Feb 16, 2006 at 8:55pm

>>
>> perhaps Ive grossly missed something (very possible), but the
>> only lighting control ive seen is with the jit.gl.render lighting
>> attributes, which seems to only apply to the ‘world light’.
>>
>> how does one create other lights, beside explicitly sending openGL
>> commands to jit.gl.sketch?
>

Currently, for additional lights you would need to use jit.gl.sketch
and the corresponding GL commands. Originally we had planned a
jit.gl.light object for Jitter 1.5, but it did not make it into the
release. Perhaps one will make it into JItter 1.5.3 or 1.5.4.

However, in theory one could make a jit.gl.sketch object which sets
up the lighting and leaves it on, thus making something like a
jit.gl.light implementation as a subpatcher. Can try to find time to
make such an example if people aren’t able to figure it out.

-Joshua

#70710
Feb 16, 2006 at 8:56pm

On Feb 16, 2006, at 8:51 AM, vade wrote:

> what would one bind the shader to, if you want to to effect the
> whole scene?

Every object. Note a shader can be bound to more than one object.

-Joshua

#70711
Feb 17, 2006 at 12:33am

Thanks for the info.

If I could be so bold as to make an official “request” for a
jit.gl.light object, that would rock, however a jit.gl.sketch
subpatcher can easily enough be created. Ill be happy to share it
with the list once I make it (and its not embarrassing :)

Thanks -

v a d e //

http://www.vade.info
abstrakt.vade.info

I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I
LIVE! I LIVE! I LIVE! I LIVE!

You will not be saved by the Holy Ghost. You will not be saved by the
God Plutonium.

In fact, YOU WILL NOT BE SAVED!

#70712
Feb 17, 2006 at 12:35am

Thanks for the info.

If I could be so bold as to make an official “request” for a
jit.gl.light object, that would rock, however a jit.gl.sketch
subpatcher can easily enough be created. Ill be happy to share it
with the list once I make it (and its not embarrassing :)

Thanks -

v a d e //

http://www.vade.info
abstrakt.vade.info

I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I
LIVE! I LIVE! I LIVE! I LIVE!

You will not be saved by the Holy Ghost. You will not be saved by the
God Plutonium.

In fact, YOU WILL NOT BE SAVED!

#70713
Feb 19, 2006 at 6:10pm

That is excellent – how do the lights created in jit.gl.sketch work in
relation to the other jit.gl.* objects? Once you create a light in
sketch, does it affect everything being rendered?

#70714
Feb 20, 2006 at 3:19am

If it is light #1 or higher it should (unless you’ve enabled the
protective OpenGL attribute stack push/pop sequence with “;jitter
glattribpush 1″. this is disabled by default)

-Joshua

#70715

You must be logged in to reply to this topic.