[x3d-public] shader question: should X3DVertexAttributeNodenameberequired?

doug sanden highaspirations at hotmail.com
Mon Mar 27 06:20:58 PDT 2017


I second Don's recommendation to review Michalis' PhD paper approach for v4 nodes
       https://castle-engine.sourceforge.io/compositing_shaders.php
-Doug
more..
Last fall, after reading Michalis' PhD paper 2x to let it sink in, and with permission/encouragement of Michalis, and using Michalis' scene files for testing, and while refactoring our internal rendering code into ubershader form, we put Effect node into freewrl, in such a way it could be used 2 places: as a field in Appearance, and as a child node in the scene graph that can affect descendants of its parent (pushed/popped on stack of Effects), and then we also used the shader compositing system for internal ubershader permutation composition. The test files often use geometry Teapot, perhaps besides Effect and other ideas, you might want to add Teapot to a v4 Level wish list.
freewrl's combination of Ubershader and Compositing Shaders infrastructure:
https://sourceforge.net/p/freewrl/git/ci/develop/tree/freex3d/src/lib/opengl/Compositing_Shaders.c

________________________________________
From: x3d-public <x3d-public-bounces at web3d.org> on behalf of Don Brutzman <brutzman at nps.edu>
Sent: March 26, 2017 6:37 PM
To: Michalis Kamburelis; John Carlson
Cc: X3D Graphics public mailing list
Subject: Re: [x3d-public] shader question: should X3DVertexAttributeNodenameberequired?

Absent any objections, will plan on documenting the naming issue in mantis and requiring Shader name values in future versions of specification + schemas + dtd + OM4X3D.

Michalis, 1M apologies for not noticing before that you produced a Ph.D. dissertation on this topic!  Wow, lots more homework to pursue:

        https://castle-engine.sourceforge.io/compositing_shaders.php

Am hoping to put this topic on a future X3D working group call (next month probably) so that we can all prepare and discuss the topic in a dedicated fashion.

Might someone be willing to collect and curate representative shader examples for X3D Example Archives?  Open source of course.  Recommended location:

        X3D Example Archives: Basic, Shaders
        http://www.web3d.org/x3d/content/examples/Basic/Shaders/

It would be great to lay out goals, issues and opportunities for improved shader support in X3D v4.

v/r Don


On 3/23/2017 7:08 PM, Michalis Kamburelis wrote:
> 2017-03-24 2:49 GMT+01:00  <yottzumm at gmail.com>:
>>
>>
>> implementations use
>>
>> prefixes when naming internal attributes (like gl_ for GLSL standard
>>
>> attributes, fw_ for FreeWRL, castle_ for Castle Game Engine...) to
>>
>> avoid this from accidentally happening.
>>
>>
>>
>>
>>
>> Yes, that’s exactly what’s making my shaders non-portable.
>>
>>
>>
>> How do we make shaders more portable.
>>
>
> Note: I'm eager to discuss that, but it's a *large* topic:) It would
> also be nice to discuss it on x3d-public mailing list.
>
> Some options that I see:
>
> 1. Pass all the information through X3DVertexAttributeNode attributes,
> do not depend on implementation-specific attributes. Yes, it will
> require some work, you will have to postprocess X3D models exported
> from your 3D modeling software.
>
> 2. Use my "Compositing Shaders" extensions, documented on
> https://castle-engine.sourceforge.io/compositing_shaders.php .
> Implemented in Castle Game Engine and FreeWRL. These are my proposed
> solution to the problem of unportable shaders.
>
> 3. Propose a scheme for all X3D renderers to follow when naming some
> standard attributes (positions, tex coords...), and write it in X3D
> specification. Problem: it's not really 100% possible, as it's very
> tied to the implementation (e.g. a renderer may pack some standard
> attributes, in order to deliver them more efficiently to shaders, with
> less bytes transferred to GPU). But  (maybe?) some specification
> suggestions (not requirements) would help in mitigating this problem,
> at least.
>
> Regards,
> Michalis


all the best, Don
--
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman

_______________________________________________
x3d-public mailing list
x3d-public at web3d.org
http://web3d.org/mailman/listinfo/x3d-public_web3d.org



More information about the x3d-public mailing list