As far as which light is which, I think there's some weird order XSI uses,
like creation order or something. But I'm not sure how reliable that really
is. I generally try to make my shaders symmetric on all the lights in the
scene for that reason. You can also check the type of the light, if that
helps. Really the lights in XSI need a parameter for openGL ID, where they
sort themselves into a designated order, and break ties based on the
existing rules or alphabetically by name or something (again, that's not
something it currently does, but something I'm casually suggesting that XSI
should do). I've also had some success in the past with using exclusive
lights to get specific lights working as the GL lights in particular
materials. Haven't tested that lately, though.
Hope this helps.
- Andy
On 1/9/08, linshier <linshier(at)gmail.com> wrote:
>
> Thanks Andy. But if there are many lights in the scene, how can I
> determine which light's position is given by silightposition_0? (Since
> if there is even one light in the scene, I move the light around, and
> realtime result don't change a bit. Do I miss any point of it?)
>
> And yes, I installed the NVIDIA's Cg Toolkit and have some idea of Cg
> language now. Can you say something more about the constants and the
> number of lights you mentioned?
>
>
> On Jan 9, 2008 6:04 PM, Andy Jones < andy(at)thefront.com> wrote:
> > It's a uniform parameter that should give you the vector position of
> that
> > particular light in your scene. It basically allows you to use the
> light
> > position in your fragment or vertex shader. A better thing would be an
> > indexable array, but as far as I know, that's not implemented in the
> > distributed realtime shaders that ship with XSI. If you had that and
> the
> > ability to recompile with constants in the shader code for the number of
> > lights in the scene, you could make better shader code. (I think you
> need
> > the constant because even though there are dynamic loops in the latest
> > shader profiles, there aren't true indexable arrays, and it still has to
> > exist as a static array. Something like that. Not sure if that's
> changed
> > since I last looked.) I'd also prefer more standard names for things if
> it
> > were up to me.
> >
> > Generally speaking, you would use the silightposition_0.xyz in a
> lighting
> > function if the light is a spotlight or point light. There are lots of
> > examples of lighting functions on the internet, if you need that.
> >
> > - Andy
> >
> >
> >
> > On 1/8/08, linshier <linshier(at)gmail.com> wrote:
> > >
> > >
> > >
> > > Hello all.
> > >
> > > Does anyone known about the CG RealTime Shaders in the xsi?
> > > I have some difficulty to understand how the CG RealTime shaders deal
> > > with the custom light in the xsi. By trying out some preset CG
> > > RealTime shaders from the NetView, I can see there are some "uniform
> > > float3 silightposition_..." like parameters that the preset main
> > > function of the vertex program will accept. So what does the
> > > "silightposition_" exactly mean? And how to use it? Would anyone have
> > > some idea about it?
> > >
> > > Thanks in advance.
> > > linshier
> > > ---
> > > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> body:
> > > unsubscribe xsi
> > >
> >
> >
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
------=_Part_21362_29133144.1199903956558
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Well, the constants and number of lights stuff I was talking about isn't in there. I was just bringing that up in hopes that it would register in Softimage's radio chatter. I would double-check that you've got just one light in the scene. Disable the "headlight". Make sure the light you have is in "Point Light" mode (or "Spot Light". Just not "Infinite" because then the light position doesn't matter.) Another thing I sometimes do when I'm testing whether something is working or not is just short-circuit its output to the output color of my realtime shader. So, you could, say, divide the light position vector by a scalar, like 10 or something, and then move it around in a positive quadrant of the scene and see if you see output colors on the object change.
<br><br>Just to check, does the shader even seem like it's compiling and executing? From the specificity of your question, I'm assuming it must, but if not, to test you can just output a solid color and see if that shows up. Like set the output color to bright red or something.
<br><br>As far as which light is which, I think there's some weird order XSI uses, like creation order or something. But I'm not sure how reliable that really is. I generally try to make my shaders symmetric on all the lights in the scene for that reason. You can also check the type of the light, if that helps. Really the lights in XSI need a parameter for openGL ID, where they sort themselves into a designated order, and break ties based on the existing rules or alphabetically by name or something (again, that's not something it currently does, but something I'm casually suggesting that XSI should do). I've also had some success in the past with using exclusive lights to get specific lights working as the GL lights in particular materials. Haven't tested that lately, though.
<br><br>Hope this helps.<br><br>- Andy<br><br><div><span class="gmail_quote">On 1/9/08, <b class="gmail_sendername">linshier</b> <<a href="mailto:linshier(at)gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
linshier(at)gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Andy. But if there are many lights in the scene, how can I<br>determine which light's position is given by silightposition_0? (Since<br>if there is even one light in the scene, I move the light around, and<br>
realtime result don't change a bit. Do I miss any point of it?)
<br><br>And yes, I installed the NVIDIA's Cg Toolkit and have some idea of Cg<br>language now. Can you say something more about the constants and the<br>number of lights you mentioned?<br><br><br>On Jan 9, 2008 6:04 PM, Andy Jones <
<a href="mailto:andy(at)thefront.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">andy(at)thefront.com</a>> wrote:<br>> It's a uniform parameter that should give you the vector position of that
<br>> particular light in your scene. It basically allows you to use the light
<br>> position in your fragment or vertex shader. A better thing would be an<br>> indexable array, but as far as I know, that's not implemented in the<br>> distributed realtime shaders that ship with XSI. If you had that and the
<br>> ability to recompile with constants in the shader code for the number of<br>> lights in the scene, you could make better shader code. (I think you need<br>> the constant because even though there are dynamic loops in the latest
<br>> shader profiles, there aren't true indexable arrays, and it still has to<br>> exist as a static array. Something like that. Not sure if that's changed<br>> since I last looked.) I'd also prefer more standard names for things if it
<br>> were up to me.<br>><br>> Generally speaking, you would use the silightposition_0.xyz in a lighting<br>> function if the light is a spotlight or point light. There are lots of<br>> examples of lighting functions on the internet, if you need that.
<br>><br>> - Andy<br>><br>><br>><br>> On 1/8/08, linshier <<a href="mailto:linshier(at)gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">linshier(at)gmail.com</a>> wrote:
<br>> ><br>> ><br>> ><br>> > Hello all.<br>> >
<br>> > Does anyone known about the CG RealTime Shaders in the xsi?<br>> > I have some difficulty to understand how the CG RealTime shaders deal<br>> > with the custom light in the xsi. By trying out some preset CG
<br>> > RealTime shaders from the NetView, I can see there are some "uniform<br>> > float3 silightposition_..." like parameters that the preset main<br>> > function of the vertex program will accept. So what does the
<br>> > "silightposition_" exactly mean? And how to use it? Would anyone have<br>> > some idea about it?<br>> ><br>> > Thanks in advance.<br>> > linshier<br>> > ---<br>> > Unsubscribe? Mail
<a href="mailto:Majordomo(at)Softimage.COM" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Majordomo(at)Softimage.COM</a> with the following text in body:<br>> > unsubscribe xsi<br>> ><br>>
<br>><br>---<br>Unsubscribe? Mail <a href="mailto:Majordomo(at)Softimage.COM" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Majordomo(at)Softimage.COM</a> with the following text in body:<br>unsubscribe xsi<br></blockquote></div><br>
------=_Part_21362_29133144.1199903956558--
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi