SourceForge has been redesigned. Learn more.

#343 SDS edge artifacts with uniform layered shading


Hey guys,

Attached is an example RIB showing a cube SDS using creasing with 3 materials applied to each face. The material shaders are using uniform user parameters and layered shading so multiple shaders can shade one geometry RIB. There appears to be artifacts where the uniform value are returned incorrectly to the shader in the creases.
I consider this important since SDS and multiple materials are natural combinations for complex projects and layered shading is a unique strength to Aqsis.

Let me know if more test scenes are needed ;-)

Eric Back (WHiTeRaBBiT)


  • Anonymous

    Anonymous - 2008-11-21

    Example RIB and render

  • Chris Foster

    Chris Foster - 2008-12-16

    I just spent some time hunting this one down, and think I understand the cause, if not the best way to fix the problem...

    Subdivision surfaces are diced with a special Dice() function instead of using CqSurface::Dice(). As such, it stores diced values directly into shader arguments. That is, inside CqSurfaceSubdivisionPatch::StoreDiceAPVar(), we have

    IqShaderData * pArg = pShader->FindArgument( pParam->strName() );

    which is meant to find the shader argument into which the variable should be stored. The values are then placed into pArg directly using pArg->SetData().

    Unfortunately this just won't work with layered shaders, since there are potentially multiple arguments, one for each layer.

    One possibility is to create a new class implementing IqShaderData to be returned from CqLayerdShader::FindArgument(), and which encapsulates a set of shader data arguments rather than the one from the top layer only. I don't think this is a very good solution, but it might be fairly minimal compared to the alternatives. Ultimately our dicing code seems to have outlived its design (compare the disparity between how user-defined and standard variables are dealt with), but fixing it properly will be a really big job :-/



Cancel  Add attachments