<div dir="ltr"><div dir="ltr">btw InstantPlayer <div> just put attributes on Lights</div><div><a href="http://doc.instantreality.org/tutorial/dynamic-shadows/">http://doc.instantreality.org/tutorial/dynamic-shadows/</a><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 24, 2019 at 10:32 AM Nicholas Polys <<a href="mailto:npolys@vt.edu">npolys@vt.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">See also:<div><br></div><div><a href="https://doc.x3dom.org/tutorials/lighting/shadows/index.html" target="_blank">https://doc.x3dom.org/tutorials/lighting/shadows/index.html</a><br></div><div><a href="https://doc.x3dom.org/tutorials/lighting/shadows/example.html" target="_blank">https://doc.x3dom.org/tutorials/lighting/shadows/example.html</a><br></div><div><br></div><div>br,</div><div>_n</div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail-m_-7540697996648432764gmail_attr">On Thu, Jan 24, 2019 at 10:29 AM Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Many thanks for your in-depth analysis.  Kwan Hee, Dick and I similarly went on a big journey over the years about whether this is inside Shape node or not.  It is interesting and tricky.<br>
<br>
Treating PTM capabilities as somewhat similar to a direction projector light source within the scene, similar to other lights, seemed to resolve several logical conflicts.  Yet aspects of texture mapping remain. Hence the current approach treats it as a separate component, defined as a collection of functionality at a similar level in the specification organization.<br>
<br>
In the interests of further convergence, if you want to suggest diffs to the current draft that better integrates alternatives you have explored, please feel free to do so.<br>
<br>
As promised I will work with Kwan Hee Yoo to get examples online (along with X3D 4.0 XML schema/DTD plus X3DUOM) to facilitate further testing and implementation.  As it turns out, I am sitting next to him here in Seoul and we have agreed to work on further progress during lunch today!<br>
<br>
Having fun with X3D Projective Texture Mapping   8)<br>
<br>
On 1/23/2019 10:51 PM, Michalis Kamburelis wrote:<br>
>   Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>> wrote:<br>
>> Michalis, if you have done any further work beyond the reference below, could you please ensure that we have the latest greatest from you related to this topic.<br>
> <br>
> My work on projective texturing is part of my "shadow maps"<br>
> extensions, documented on<br>
> <a href="https://castle-engine.io/x3d_extensions_shadow_maps.php" rel="noreferrer" target="_blank">https://castle-engine.io/x3d_extensions_shadow_maps.php</a> .<br>
> <br>
> Of course it can be used without shadow maps too, just to cast<br>
> textures. The goal was to easily define a way to project texture from<br>
> a light source or a viewpoint, using "ProjectedTextureCoordinate" node<br>
> that can be used in a similar way to the standard<br>
> "TextureCoordinateGenerator". In particular, casting a texture from a<br>
> light source is essential to perform shadow mapping, that's why I<br>
> developed my projective texturing extension "by the way" of developing<br>
> shadow maps extensions.<br>
> <br>
> A simple example how does it look like is on:<br>
> <a href="https://github.com/castle-engine/demo-models/blob/master/shadow_maps/projective_texturing_simple.x3dv" rel="noreferrer" target="_blank">https://github.com/castle-engine/demo-models/blob/master/shadow_maps/projective_texturing_simple.x3dv</a><br>
> . You can open it with view3dscene (<br>
> <a href="http://michalis.ii.uni.wroc.pl/view3dscene-snapshots/" rel="noreferrer" target="_blank">http://michalis.ii.uni.wroc.pl/view3dscene-snapshots/</a> ). I also attach<br>
> a screenshot.<br>
> <br>
> Notable differences from my approach and Kwan's:<br>
> <br>
> (I'm not trying to say here which one is better! I like Kwan's<br>
> approach. But I explain how, and why, my approach was different.)<br>
> <br>
> 1. Kwan adds projector nodes that are defined outside of "Shape".<br>
> Projector node affects many shapes, using the "global" or "scoped"<br>
> mechanism.<br>
> <br>
>      In contrast, my "ProjectedTextureCoordinate" is placed within a<br>
> "texCoord" field of a geometry. So you need to explicitly add it to<br>
> the relevant geometry nodes. My "ProjectedTextureCoordinate" was<br>
> modeled after standard "TextureCoordinateGenerator", so it cooperates<br>
> with multi-texturing in the same way. You can have 1st texture layer<br>
> coordinates determined by "ProjectedTextureCoordinate", and 2nd<br>
> texture layer coordinates determined by something else (like<br>
> "TextureCoordinateGenerator" or explicit "TextureCoordinate").<br>
> <br>
> 2. Kwan projector nodes define their own projection parameters. The<br>
> node type ("TextureProjectorPerspective" or<br>
> "TextureProjectorParallel") determines if the projection is<br>
> perspective or orthogonal.<br>
> <br>
>      In contrast, my "ProjectedTextureCoordinate" refers to a light<br>
> source / viewpoint node. You can use DEF / USE mechanism to refer to<br>
> an existing light source / viewpoint this way, or you can define new<br>
> light source / viewpoint inside. The projection parameters and type<br>
> are determined looking at the node type (e.g. "OrthoViewpoint" or<br>
> "DirectionalLight" result in orthogonal projection, "Viewpoint" or<br>
> "SpotLight" result in perspective projection). In some cases I needed<br>
> to add addtional fields to lights, see<br>
> <a href="https://castle-engine.io/x3d_extensions_shadow_maps.php#section_light_parameters" rel="noreferrer" target="_blank">https://castle-engine.io/x3d_extensions_shadow_maps.php#section_light_parameters</a><br>
> . E.g. all light sources have a new "projectionNear", "projectionFar"<br>
> fields.<br>
> <br>
>      This was a necessity in my case. We *need* to have projection<br>
> parameters specified at a light source, to make shadows maps possible<br>
> from this light source. Then we can guarantee using the same<br>
> projection parameters when (A) generating the shadow maps, and when<br>
> (B) displaying the shadow maps. If projection parameters used for (A)<br>
> and (B) would be different, shadow maps would not work OK.<br>
> <br>
> 3. In summary, my specification modifies more stuff in X3D. It relies<br>
> on existing "texCoord" field, light sources and viewpoints nodes, and<br>
> uses them. I also had to extend existing light sources with new<br>
> fields.<br>
> <br>
> Regards,<br>
> Michalis<br>
<br>
all the best, Don<br>
-- <br>
Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149<br>
X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" rel="noreferrer" target="_blank">http://faculty.nps.edu/brutzman</a><br>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-7540697996648432764gmail_signature">Nicholas F. Polys, Ph.D.<br><br>Director of Visual Computing <br>Virginia Tech Research Computing <br><br>Affiliate Professor<br>Virginia Tech Department of Computer Science<br></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Nicholas F. Polys, Ph.D.<br><br>Director of Visual Computing <br>Virginia Tech Research Computing <br><br>Affiliate Professor<br>Virginia Tech Department of Computer Science<br></div>