[sldev] Tutorial for SL shaders ("for dummies")?

Brad Kittenbrink (Brad Linden) brad at lindenlab.com
Thu Dec 17 17:30:08 PST 2009


The place to start looking is in class1/objects/simple{F,V}.glsl

Things quickly get complicated from there, however.  We have a relatively
complex shader system compared to most games I'm aware of, where we rely
heavily on the GLSL linker to provide seams for swapping out functionality
based on available hardware.  You can see an example of this with how the
class{1,2}/lighting/lightV.glsl files interact with
class{1,2,3}/lighting/sumLightsV.glsl.

This system makes it relatively easy to implement our complicated matrix of
graphics preferences and compatibility featuretable masks, but it can make
it very hard to trace the execution of a particular shader, as it's often
unclear which exact files are being loaded and executed on a particular
machine.

It's often worth it to watch the log console for LLShaderMgr::loadShaderFile
entries as it dumps what combinations of shader files it's linking.  I think
this debugging info is enabled by default, but in case it's not see
http://wiki.secondlife.com/wiki/Logging_System_Overview for info about how
to reenable it in logcontrol-dev.xml.

I hope this is enough to get you started, let me know if you have more
questions...

-Brad


On Tue, Dec 15, 2009 at 2:57 PM, Mike Monkowski
<monkowsk at fishkill.ibm.com>wrote:

> Tigro Spottystripes wrote:
> > Somewhere between the two, worse case at least somthing explaining the
> > specifics of how SL uses it and what are the particularities for the
> > .glsl files the client uses (including the exact structure of files and
> > things that work and doesn't work, things that are not following the
> > standards etc)
>
> Well, the "worst case" documentation is probably
> app_settings/shaders/shader_hierarchy.txt
> then you look at llviewershadermgr.cpp
>
> I haven't done more than look at them, but the in-line comments don't
> look too bad.
>
> It would be nice if doxygen handeled GLSL, but I don't think it does.
>
> Mike
> _______________________________________________
> Policies and (un)subscribe information available here:
> http://wiki.secondlife.com/wiki/SLDev
> Please read the policies before posting to keep unmoderated posting
> privileges
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/sldev/attachments/20091217/4b0af3f7/attachment.htm 


More information about the SLDev mailing list