[osg-users] Loading a SilverLining environment map into an OpenSceneGraph texture

Trajce Nikolov NICK trajce.nikolov.nick at gmail.com
Fri Feb 16 06:46:19 PST 2018


Hi,

you can get inspiration from the OpenIG project (http://openig.compro.net)
, there is a SilverLining plugin (
https://github.com/CCSI-CSSI/MuseOpenIG/tree/master/Plugin-SilverLining)
with reflections working together with Triton

On Thu, Feb 15, 2018 at 3:51 PM, Chris Hardy <hardyc02 at gmail.com> wrote:

> It turns out this is pretty easy, I just made a couple of silly
> uncaffeinated mistakes. In case anyone gets stuck in the same hole, all you
> have to do is create your own TextureObject and assign it to the
> TextureCubeMap.
>
> Perhaps there are some finer details missing in this solution but the
> output on the screen is at least accurate to what I want for the moment.
>
>
> Code:
>
> unsigned int handle;
> void* ptr = &handle;
> atm->GetEnvironmentMap(ptr, 6);
>
> osg::TextureCubeMap* hdrEnvMap = new osg::TextureCubeMap;
> osg::Texture::TextureObject* textureObject = new
> osg::Texture::TextureObject(hdrEnvMap, (GLuint)ptr, GL_TEXTURE_CUBE_MAP);
> hdrEnvMap->setTextureObject(camera->getGraphicsContext()->getState()->getContextID(),
> textureObject);
>
>
>
>
> My reflections are the wrong way around but that's my own problem I
> suppose. :P
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=72962#72962
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180216/8ba9375b/attachment.html>


More information about the osg-users mailing list