mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
Use ICO for water shader
This commit is contained in:
parent
92bed66e5f
commit
d707eaac36
@ -255,6 +255,7 @@ public:
|
|||||||
attach(osg::Camera::COLOR_BUFFER, mRefractionTexture);
|
attach(osg::Camera::COLOR_BUFFER, mRefractionTexture);
|
||||||
|
|
||||||
mRefractionDepthTexture = new osg::Texture2D;
|
mRefractionDepthTexture = new osg::Texture2D;
|
||||||
|
mRefractionDepthTexture->setTextureSize(rttSize, rttSize);
|
||||||
mRefractionDepthTexture->setSourceFormat(GL_DEPTH_COMPONENT);
|
mRefractionDepthTexture->setSourceFormat(GL_DEPTH_COMPONENT);
|
||||||
mRefractionDepthTexture->setInternalFormat(GL_DEPTH_COMPONENT24);
|
mRefractionDepthTexture->setInternalFormat(GL_DEPTH_COMPONENT24);
|
||||||
mRefractionDepthTexture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);
|
mRefractionDepthTexture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);
|
||||||
@ -334,6 +335,7 @@ public:
|
|||||||
setUpdateCallback(new NoTraverseCallback);
|
setUpdateCallback(new NoTraverseCallback);
|
||||||
|
|
||||||
mReflectionTexture = new osg::Texture2D;
|
mReflectionTexture = new osg::Texture2D;
|
||||||
|
mReflectionTexture->setTextureSize(rttSize, rttSize);
|
||||||
mReflectionTexture->setInternalFormat(GL_RGB);
|
mReflectionTexture->setInternalFormat(GL_RGB);
|
||||||
mReflectionTexture->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR);
|
mReflectionTexture->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR);
|
||||||
mReflectionTexture->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
|
mReflectionTexture->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
|
||||||
@ -418,9 +420,6 @@ Water::Water(osg::Group *parent, osg::Group* sceneRoot, Resource::ResourceSystem
|
|||||||
mWaterGeom->setDrawCallback(new DepthClampCallback);
|
mWaterGeom->setDrawCallback(new DepthClampCallback);
|
||||||
mWaterGeom->setNodeMask(Mask_Water);
|
mWaterGeom->setNodeMask(Mask_Water);
|
||||||
|
|
||||||
if (ico)
|
|
||||||
ico->add(mWaterGeom);
|
|
||||||
|
|
||||||
mWaterNode = new osg::PositionAttitudeTransform;
|
mWaterNode = new osg::PositionAttitudeTransform;
|
||||||
mWaterNode->setName("Water Root");
|
mWaterNode->setName("Water Root");
|
||||||
mWaterNode->addChild(mWaterGeom);
|
mWaterNode->addChild(mWaterGeom);
|
||||||
@ -439,6 +438,9 @@ Water::Water(osg::Group *parent, osg::Group* sceneRoot, Resource::ResourceSystem
|
|||||||
mRainIntensityUniform = new osg::Uniform("rainIntensity",(float) 0.0);
|
mRainIntensityUniform = new osg::Uniform("rainIntensity",(float) 0.0);
|
||||||
|
|
||||||
updateWaterMaterial();
|
updateWaterMaterial();
|
||||||
|
|
||||||
|
if (ico)
|
||||||
|
ico->add(mWaterNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::Uniform *Water::getRainIntensityUniform()
|
osg::Uniform *Water::getRainIntensityUniform()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user