diff --git a/components/fx/pass.cpp b/components/fx/pass.cpp index 16480128b7..b2fb8b2ffb 100644 --- a/components/fx/pass.cpp +++ b/components/fx/pass.cpp @@ -239,13 +239,13 @@ float omw_GetPointLightRadius(int index) stateSet->setAttribute(program); if (mBlendSource && mBlendDest) - stateSet->setAttribute(new osg::BlendFunc(mBlendSource.value(), mBlendDest.value())); + stateSet->setAttributeAndModes(new osg::BlendFunc(mBlendSource.value(), mBlendDest.value())); if (mBlendEq) - stateSet->setAttribute(new osg::BlendEquation(mBlendEq.value())); + stateSet->setAttributeAndModes(new osg::BlendEquation(mBlendEq.value())); if (mClearColor) - stateSet->setAttribute(new SceneUtil::ClearColor(mClearColor.value(), GL_COLOR_BUFFER_BIT)); + stateSet->setAttributeAndModes(new SceneUtil::ClearColor(mClearColor.value(), GL_COLOR_BUFFER_BIT)); } void Pass::dirty() diff --git a/docs/source/reference/postprocessing/omwfx.rst b/docs/source/reference/postprocessing/omwfx.rst index 7b5c6d2e79..e828bd8e6f 100644 --- a/docs/source/reference/postprocessing/omwfx.rst +++ b/docs/source/reference/postprocessing/omwfx.rst @@ -502,7 +502,7 @@ is not wanted and you want a custom render target. +------------------+---------------------+-----------------------------------------------------------------------------+ | width_ratio | float | Automatic width as a percentage of screen width | +------------------+---------------------+-----------------------------------------------------------------------------+ -| height_ratio | float | Automatic width as a percentage of screen height | +| height_ratio | float | Automatic height as a percentage of screen height | +------------------+---------------------+-----------------------------------------------------------------------------+ | width | float | Width in pixels | +------------------+---------------------+-----------------------------------------------------------------------------+ @@ -511,10 +511,9 @@ is not wanted and you want a custom render target. | mipmaps | boolean | Whether mipmaps should be generated every frame | +------------------+---------------------+-----------------------------------------------------------------------------+ +To use the render target a pass must be assigned to it, along with any optional clear or blend modes. -To use the render target you must assign passes to it, along with any optional clear modes or custom blend modes. - -In the code snippet below a rendertarget is used to draw the red cannel of a scene at half resolution, then a quarter. As a restriction, +In the code snippet below a rendertarget is used to draw the red channel of a scene at half resolution, then a quarter. As a restriction, only three render targets can be bound per pass with ``rt1``, ``rt2``, ``rt3``, respectively. .. code-block:: none @@ -552,21 +551,9 @@ only three render targets can be bound per pass with ``rt1``, ``rt2``, ``rt3``, } } -Now, if we ever run the `downsample2x` pass it will write to the target buffer instead of the default +Now, when the `downsample2x` pass runs it will write to the target buffer instead of the default one assigned by the engine. -To use the uniform you can reference it in any pass, it should **not** be declared with the ``uniform`` keyword. - -.. code-block:: none - - fragment pass { - void main() - { - // ... - vec3 color = uColor; - } - } - Simple Example ##############