[x3d-public] Specification editors mantis issues, PointProperties
Michalis Kamburelis
michalis.kambi at gmail.com
Mon Sep 7 02:23:06 PDT 2020
Hi Andreas,
Very happy to hear that it works nicely! :)
1. About using per-vertex colors with vertexes (you mentioned "I think
vertex colors should be treated as diffuse color (or base color for PBR) if
normals are present"):
This is answered by the spec, by saying "points/lines should behave the
same as any other geometry" :) So you should follow the Color / ColorRGBA
nodes specification,
https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-WD2/Part01/components/rendering.html#Color
. Indeed per-vertex colors just replace "Material.diffuseColor" or
"PhysicalMaterial.baseColor" or "UnlitMaterial.emissiveColor".
2. As for texture coordinates:
Thanks for wiki improvement, I added there additional paragraph:
"""
Note that points/lines (PointSet, LineSet, IndexedLineSet) do not have a
texCoord field, and so you cannot use nodes like TextureCoordinate or
TextureCoordinateGenerator with them. This may change in future X3D
versions (glTF allows texture coordinates on points/lines, just as on other
geometry nodes).
"""
I would say one day we could introduce "texCoord" field for points/lines
and thus allow explicit texture coordinates (TextureCoordinate and also
TextureCoordinateGenerator). Thus we would make points/lines even *more*
similar to other geometry nodes. glTF allows explicit texture coordinates
for points, as far as I know, without any special rules (though I didn't
test it with any glTF viewer).
3. I have moved the relevant prose to common section and improved, to make
it clear what to do in some edge-cases. Comment welcome :)
""""
11.2.2.5 Points and lines rendering
It is not possible to automatically calculate normal vectors for point and
line geometry nodes (PointSet, LineSet, IndexedLineSet). Therefore, the
following rules apply when rendering these nodes:
-
If the *normal* field contains a Normal node then points and lines are
rendered using the same lighting equations as the other geometry and can be
lit.
-
If the *normal* information is not provided (the *normal* field remains
NULL) then points and lines are rendered using the "unlit" lighting
equations, following 17.2.2.4 Unlit lighting model. Authors are advised
to use UnlitMaterial to customize the look of unlit points and lines.
If the Material node is used together with unlit points and lines, then
it is rendered as unlit and only the *emissiveColor* of this node is
used.
*Note:* The *emissiveTexture* of Material node is ignored in this case.
Using the *Material.emissiveColor* is a special rule, only to provide
compatibility with X3D 3, which is why it is deliberately limited, and
doesn't provide any way to use *Material.emissiveTexture* or any
*PhysicalMaterial* feature on unlit point and lines.
If any other material node is used together with unlit points and lines,
then it is rendered as white unlit.
Regardless of the *normal* field, rendering of the points and lines can be
customized using textures, *Color*, *ColorRGBA* and *UnlitMaterial* nodes.
"""
Regards,
Michalis
niedz., 6 wrz 2020 o 03:00 Andreas Plesch <andreasplesch at gmail.com>
napisał(a):
> The basic point sprites example at
>
>
> https://www.web3d.org/x3d/content/examples/Basic/Points/BasicPointSpritesIndex.html
>
> looks good in principle but has a few problems. The MinValue is larger
> than the MaxValue and the field name is now just attenuation. This
> line works well for me now:
>
> <PointProperties containerField='pointProperties' attenuation='1.0 1.0
> 0.0' pointSizeMinValue='1' pointSizeMaxValue='100'
> pointSizeScaleFactor='200'/>
>
> Note that the attenuation formula works in world coordinates and that
> attenuation smaller than 1 can lead to magnification. The formula is
> somewhat unintuitive and typically leads to the parameters being
> determined experimentally. But I do not have an idea for another
> formula.
>
> Ok, I figured how to use Game Bar recording on Win10 and sharing with
> OneDrive: https://1drv.ms/v/s!AuiWzyTgDji2i2JPSxjhuSp0OlOO?e=RJLPab
>
> -Andreas
>
> On Fri, Sep 4, 2020 at 9:16 PM Andreas Plesch <andreasplesch at gmail.com>
> wrote:
> >
> > Working next on sprite texturing for PointProperties, I found it
> > pretty straightforward to start to support textures of any kind since
> > the shader or shader generation needs to deal with those already. The
> > only difference to other geometry is to use gl_PointCoord as tex.
> > coord, rather than provided tex. coords. This is a simple
> > intensity-alpha 3x3 PixelTexture mixed with the Material color:
> >
> >
> https://raw.githack.com/andreasplesch/x3dom/PointSetNormals/test/regression-suite/test/cases/points/pointset_archie_normal.html
> >
> > CSS or PBR textures with normal and other nice maps should also work,
> > for example.
> >
> > It looks like it is time to test a bit more and then merge with the
> > x3dom dev. branch.
> >
> > Here is another test with 1.5 million points, adopted from
> > http://metagrid2.sv.vt.edu/~yansh93/catawba_blinn.html
> >
> >
> https://raw.githack.com/andreasplesch/x3dom/PointSetNormals/test/regression-suite/test/cases/points/catawba50.html
> >
> > Lidar surveys easily generate large point clouds like this. The
> > PointSet is actually much subsampled. I also discovered that the
> > original binary data has some interesting tail which may or may not be
> > junk from processing.
> >
> > It was difficult to generate and deal with a very large xml file, so I
> > had to put the data in separate files and load via js. The final scene
> > is still xml (actually DOM) in memory, generated with a few lines of
> > js DOM manipulation.
> >
> > x3dom has BufferGeometry for binary geometry data (used for glTF)
> > which becomes really necessary for these kind of datasets. As far as I
> > remember x3dv4 will not have an equivalent. Maybe I should check how
> > hard it would be to support PointProperties for BufferGeometry (which
> > can be points).
> >
> > The test shows that vertex colors also work with shading and
> > PointProperties, after mixing in a white diffuseColor. I think this is
> > as expected since vertex colors used to be emissive. Actually, I am
> > changing my mind. I think vertex colors should be treated as diffuse
> > color (or base color for PBR) if normals are present. Let's see how
> > this looks in the shader generation for x3dom.
> >
> > -Andreas
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Andreas
> >
> > On Thu, Sep 3, 2020 at 6:06 PM Andreas Plesch <andreasplesch at gmail.com>
> wrote:
> > >
> > > Since both x_ite and
> > >
> > > http://metagrid2.sv.vt.edu/~yansh93/archimedes_pp_normal.html
> > >
> > > use circles for point rendering, this x3dom draft implementation now
> > > also uses circles:
> > >
> > >
> https://raw.githack.com/andreasplesch/x3dom/PointSetNormals/test/regression-suite/test/cases/points/pointset_archie_normal.html
> > >
> > > Circles are only used for untextured points. For textured points, eg.
> > > sprites, the masking for circles will be omitted.
> > >
> > > Should the spec. require circles for untextured points ? They look
> > > better but perhaps such a requirement is too opinionated.
> > >
> > > -Andreas
> > >
> > > On Thu, Sep 3, 2020 at 4:33 PM Andreas Plesch <andreasplesch at gmail.com>
> wrote:
> > > >
> > > > I updated the implementation and the scene to reflect the latest
> > > > changes in the spec. draft:
> > > >
> > > >
> https://raw.githack.com/andreasplesch/x3dom/PointSetNormals/test/regression-suite/test/cases/points/pointset_archie_normal.html
> > > >
> > > > There are no visual differences.
> > > >
> > > > -Andreas
> > > >
> > > > On Thu, Sep 3, 2020 at 4:08 PM Andreas Plesch <
> andreasplesch at gmail.com> wrote:
> > > > >
> > > > > I had some time to refocus on PointProperties and found this note
> on
> > > > > spec. changes:
> > > > >
> > > > > > Date: Mon, 31 Aug 2020 10:33:40 -0700
> > > > > > From: Don Brutzman <brutzman at nps.edu>
> > > > > > To: Michalis Kamburelis <michalis.kambi at gmail.com>,
> > > > > > "puk at igraphics.com" <puk at igraphics.com>
> > > > > > Cc: X3D Graphics public mailing list <x3d-public at web3d.org>
> > > > > > Subject: Re: [x3d-public] Specification editors mantis issues:
> PBR
> > > > > > review
> > > > > > ..
> > > > > > On 8/24/2020 12:48 PM, Michalis Kamburelis wrote:
> > > > > > >
> > > > > > > [...]
> > > > > > > Answers are inline below.
> > > > > > >
> > > > > > > Don Brutzman <brutzman at nps.edu <mailto:brutzman at nps.edu>>
> wrote:
> > > > > > >
> > > > > > > ---
> > > > > > > 2. Spec questions.
> > > > > > >
> > > > > > > a. see new inquiries today regarding PointProperties from
> Andreas and Holger.? Let's continue/contribute on that thread please.
> > > > > > >
> > > > > > > I do not see input from Holger in the PointProperties thread.
> If there's some communication off-list, maybe because someone forgot to use
> "Reply All", please resend it to the mailing list :)
> > > > > >
> > > > > > Separate thread found at
> > > > > >
> > > > > > [1] [x3d-public] PointProperties revisited
> > > > > >
> https://web3d.org/pipermail/x3d-public_web3d.org/2020-August/013447.html
> > > > > >
> > > > > > We agreed to remove 'colorMode' and updated both spec & Mantis
> 1252.
> > > > > >
> > > > > > We replaced final 2 paragraphs in 11.4.11 PointSet with
> > > > > >
> > > > > > "If the normal field of the PointSet node contains normal
> vectors, then points are rendered using the same lighting equations as the
> other geometry and can be lit. If the normal vectors are not provided, the
> points are rendered following the "unlit" lighting equations. If the
> PointSet is used with the Material node, and the normal vectors of points
> are not provided, the points shall be rendered as unlit, using the
> emissiveColor field of the Material node. In both cases, the points look
> can be customized using textures, Color, ColorRGBA, and UnlitMaterial
> nodes."
> > > > >
> > > > > That sounds great, and should cover all situations.
> > > > >
> > > > > I developed a first implementation of PointProperties with normals,
> > > > > ignoring textures for now:
> > > > >
> > > > >
> https://raw.githack.com/andreasplesch/x3dom/PointSetNormals/test/regression-suite/test/cases/points/pointset_archie_normal.html
> > > > >
> > > > > This is the archie example modified to use a diffuseColor material
> for
> > > > > shading with normals, and a non-default attenuation factor of "1 1
> 0",
> > > > > eg. with a linear distance dependence.
> > > > >
> > > > > The point size attenuation looks similar to how x_ite is scaling
> > > > > (x_ite ignores the normals currently), so that is good sign. Here
> is
> > > > > the x3d xml version:
> > > > >
> > > > >
> https://raw.githubusercontent.com/andreasplesch/x3dom/PointSetNormals/test/regression-suite/test/cases/points/pointset_archie_normal.x3d
> > > > >
> > > > > freeWrl 4.7 does not seem to do the size attenuation with distance,
> > > > > not sure if it is not implemented or another interpretation.
> > > > >
> > > > > Oh, I see that this draft
> > > > >
> > > > >
> https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-WD2/Part01/components/shape.html#PointProperties
> > > > >
> > > > > changed the attenuation field from MFFloat to SFVec3f, and the name
> > > > > from pointSizeAttenuation to just attenuation. Should be a quick
> fix.
> > > > >
> > > > > In the same spirit, I would also suggest renaming
> "pointSizeMinValue"
> > > > > to "pointSizeMin" or just "sizeMin" (we are in _Point_Properties,
> > > > > after all), and "pointSizeMaxValue" accordingly.
> > > > >
> > > > > -Andreas
> > > > >
> > > > > --
> > > > > Andreas Plesch
> > > > > Waltham, MA 02453
> > > >
> > > >
> > > >
> > > > --
> > > > Andreas Plesch
> > > > Waltham, MA 02453
> > >
> > >
> > >
> > > --
> > > Andreas Plesch
> > > Waltham, MA 02453
> >
> >
> >
> > --
> > Andreas Plesch
> > Waltham, MA 02453
>
>
>
> --
> Andreas Plesch
> Waltham, MA 02453
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200907/e87fc477/attachment-0001.html>
More information about the x3d-public
mailing list