[osg-submissions] ShadowMap update
Robert Osfield
robert.osfield at gmail.com
Tue Oct 2 03:37:42 PDT 2007
Hi Mahai,
I've applied your change but get the follow errors when I run
osgshadow cow.osg --base -sm
FRAGMENT glCompileShader "" FAILED
FRAGMENT Shader "" infolog:
(8) : error C1008: undefined variable "ambientBias"
(8) : error C1008: undefined variable "ambientBias"
glLinkProgram "" FAILED
Program "" infolog:
Fragment info
-------------
(8) : error C1008: undefined variable "ambientBias"
(8) : error C1008: undefined variable "ambientBias"
There is also a white rectangle overlayed on the window, I presume
this is your debug camera. This should not be there by default.
On compile I also got the following warnings:
/home/robert/OpenSceneGraph/src/osgShadow/ShadowMap.cpp: In member
function 'virtual void osgShadow::ShadowMap::init()':
/home/robert/OpenSceneGraph/src/osgShadow/ShadowMap.cpp:141: warning:
converting to 'unsigned int' from 'float'
/home/robert/OpenSceneGraph/src/osgShadow/ShadowMap.cpp:142: warning:
converting to 'unsigned int' from 'float'
Could you please fix these problems and resubmit as the changes aren't
suitable for integration with 2.2 as they are.
Robert.
On 10/1/07, Mihai Radu <radu at cm-labs.com> wrote:
> Hi Robert,
>
> I hope it's not to late to have some additions to ShadowMap included in
> the 2.2 release.
> CM-Labs will be using this as the basis for shadows in the osg 2.2 based
> simulator, and it would help a lot to have some of these additions into
> the main osg.
> If the there is no quick fix for using spot-lights I can chop-out that
> part of the code and re-post the files asap.
>
> Most of the additions are small utility methods:
> - set the resolution of the shadow map; it calls dirty() to
> re-initialize at next update
> - keep a list of Shader objects to use instead of the default ones, if
> the list is empty, the default shaders are used
> - explicitly create the Uniform variables, so that subsequent additions
> that require more Uniforms can put them in a central place
> - set a Light or LightSource to use explicitly for shadow casting,
> allows multiple lights in the scene, with one casting shadows
>
> There are two additions that do not ( yet ) function correctly, but in
> the present usage they do not interfere with the regular usage of the
> techique:
> - support for using spotlights, it's using Light.spotCutoff to determine
> if it's a spot-light and not point-light,
> there is an error in the setup of either the shadow camera or the
> texgen, most likely due to the direction of the spotlight, since the
> position is being used just like in point or directional lights.
> - creation of a debugHUD
> the hud is created properly, ( the example included shows it ), but
> it displays only white, there has been some discussion of displaying the
> shadow map, but I could not find it, the addition of a simple fragment
> shader with the appropriate color transform should get this going.
>
> Thank you for your patience
> Mihai Radu
>
> _______________________________________________
> osg-submissions mailing list
> osg-submissions at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
>
More information about the osg-submissions
mailing list