Re: Current Post Processing support

Pedro Arthur <[email protected]> Thu, 25 Apr 2013 15:50:56 -0300
Newsgroups gmane.comp.graphics.crystalspace.devel
Message-ID <CAKN1MR66dd=tEB81miBKMG54j5i_J+wscJdnMAhBKbDX81Yo2w@mail.gmail.com>
After reading the  commited SSDO code I got some ideas:

I observed that most of the SSDOManager code is to setup layers (input/
output) and chain it correctly. So I was thinking to improve the
PostProcessParser moving all these configurations (common to most effects)
from hardcoded C++ to the effect xml file, and the manager only will be
used to change effect related input parameters. Then we can get more
flexibility for further effects implementation.
Here is a simple example on how the SSDO effect file would be:

<posteffect>
    <layer name="ssdo" shader="/data/.../ssdo.xml">
        <!--  Setup default shader variables-->
        <parameter name="sample radius" default="1.0"/>
        <parameter name="num passes" default="2"/>
        <parameter name="occlusion strength" default="1.0"/>
        <parameter name="bounce strength" default="1.0"/>

        <!--  Setup which textures will be used as input-->
        <input name="depthTexture" texname="tex depth"/>
        <input name="normalTexture" texname="tex normal"/>

        <!--  load lookup textures automatically -->
        <input name="rndNormalTexture" source="/data/rndNormal.png"/>

        <!--
                Setup output textures
                if the effect uses multiple outputs  or used a custom tex
format
                if not specified use defaul output
         -->
        <output name="SSDOOutputTex" format="rgb8">
    <layer>
    <layer name="blur_v" shader="/data/.../blur_v.xml">
        (...)
    <layer>
    <layer name="blur_h" shader="/data/.../blur_h.xml">
        (...)
    <layer>
    (...)
</posteffect>


The PostProcessParser will then
1. Setup layer shader variables
2. Setup which input will be used
3. Load static lookup textures automatically
4. Create/ setup output textures
5. Construct and optimise the layer chain reusing common output textures.


What do you think about this idea?

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr

_______________________________________________
Crystal-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-develop