Skip to content

Commit 0eab5fa

Browse files
committed
don't adjust alpha by a power function in TextFont text shader; add history for version 2.0.0.beta2
1 parent 3f90183 commit 0eab5fa

File tree

6 files changed

+146
-12
lines changed

6 files changed

+146
-12
lines changed

doc/tutorial-history.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,37 @@
55
<a id=Version_History></a>
66
## Version History
77

8+
Version 2.0.0-beta2:
9+
10+
The changes in beta 2 from beta 1 include:
11+
12+
- Added H3DU.PbrMaterial class and supported physically-based shading in the default shader.
13+
- H3DU.Shape objects contain H3DU.PbrMaterial by default.
14+
- Extras folder contains a glTF loader, which is preliminary and incomplete.
15+
- H3DU.Scene3D will create a WebGL 2 rendering context if possible and supported by the browser.
16+
- H3DU.MeshBuffer stores vertex data by semantic (such as position, normal or texture coordinates), rather than by name.
17+
- The new H3DU.Semantic class contains constants for attribute and uniform semantics.
18+
- The new H3DU.TextureInfo class is a lightweight class for storing a texture's settings, but not its data.
19+
- H3DU.ShaderInfo class can now accept H3DU.TextureInfo objects as uniform values.
20+
- H3DU.Material can accept a parameter object in the constructor as it can in the setParams method, similarly to the
21+
new H3DU.PbrMaterial class.
22+
- Added fromBasic and fromBasicTexture methods to H3DU.Material class.
23+
- Many new methods were added to the H3DU.Math class, including methods to add and
24+
subtract 4-element vectors, to clamp vectors, and to convert to and from linear RGB colors,
25+
as well as vec3proj, vec4proj, mat3invert, and vec3fromWindowPoint methods.
26+
The frustumHasBox method was improved.
27+
- The shapeCount, getShape, setShape, and copy methods were added to H3DU.ShapeGroup.
28+
- New H3DU.CubeMap class holds information on the textures that make up a cube map.
29+
However, cube maps are not yet supported in the default shader (its code is
30+
currently commented out)
31+
- In the H3DU.GraphicsPath extra, added methods for high-level shapes and path
32+
interpolation and improved code on path triangulation.
33+
- H3DU.TextFont extra supports multichannel signed distance field fonts.
34+
- Several new demos were added.
35+
- Some methods were removed: setMaterialParams methods from both H3DU.Shape and H3DU.ShapeGroup; mapTexture and mapTexturesAll methods from TextureLoader; forShader method from H3DU.Material.
36+
- Renamed setOrientation and multOrientation in H3DU.Transform to setRotation and multRotation, and deprecated the old names.
37+
- Bug fixes.
38+
839
Version 2.0.0-beta1:
940

1041
There are many, many changes to version 2.0.0-beta1 from version 1.5.1. Here are some of them, including the most important ones.

doc/tutorial-overview.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ The library differs from many others because this one is in the public domain, s
1313

1414
This page includes information on how to use the HTML 3D library, an overview of its features, and an example of a simple 3D-enabled Web page.
1515

16+
NOTE: This section and the rest of this page will largely discuss the 2.0.0-beta2 version of the HTML 3D library, which differs considerably from the current release (version 1.5.1) of the library. (See the section "History" for more information.)
17+
1618
<a id=Example></a>
1719
## Example
1820

@@ -21,7 +23,7 @@ This page includes information on how to use the HTML 3D library, an overview of
2123
<a id=Contents></a>
2224
## Contents
2325

24-
[Public-Domain HTML 3D Library](#Public_Domain_HTML_3D_Library)<br>[Example](#Example)<br>[Contents](#Contents)<br>[How to Use](#How_to_Use)<br>&nbsp;&nbsp;[List of Classes](#List_of_Classes)<br>&nbsp;&nbsp;[`H3DU.Scene3D`](#H3DU_Scene3D)<br>&nbsp;&nbsp;[The "Camera"](#The_Camera)<br>&nbsp;&nbsp;[3D Models](#3D_Models)<br>&nbsp;&nbsp;[Shapes](#Shapes)<br>&nbsp;&nbsp;[The Render Loop](#The_Render_Loop)<br>[A Skeleton for 3D Apps](#A_Skeleton_for_3D_Apps)<br>[Demos](#Demos)<br>&nbsp;&nbsp;[Simple Demos](#Simple_Demos)<br>&nbsp;&nbsp;[Materials](#Materials)<br>&nbsp;&nbsp;[Shapes and meshes](#Shapes_and_meshes)<br>&nbsp;&nbsp;[Paths](#Paths)<br>&nbsp;&nbsp;[Curves and Surfaces](#Curves_and_Surfaces)<br>&nbsp;&nbsp;[Textures](#Textures)<br>&nbsp;&nbsp;[Shaders](#Shaders)<br>&nbsp;&nbsp;[Particle Systems](#Particle_Systems)<br>&nbsp;&nbsp;[Loading 3D Models](#Loading_3D_Models)<br>&nbsp;&nbsp;[Selecting Objects](#Selecting_Objects)<br>&nbsp;&nbsp;[Text](#Text)<br>&nbsp;&nbsp;[Miscellaneous](#Miscellaneous)<br>[Example](#Example)<br>
26+
[Public-Domain HTML 3D Library](#Public_Domain_HTML_3D_Library)<br>[Example](#Example)<br>[Contents](#Contents)<br>[How to Use](#How_to_Use)<br>&nbsp;&nbsp;[List of Classes](#List_of_Classes)<br>&nbsp;&nbsp;[`H3DU.Scene3D`](#H3DU_Scene3D)<br>&nbsp;&nbsp;[The "Camera"](#The_Camera)<br>&nbsp;&nbsp;[3D Models](#3D_Models)<br>&nbsp;&nbsp;[Shapes](#Shapes)<br>&nbsp;&nbsp;[The Render Loop](#The_Render_Loop)<br>[A Skeleton for 3D Apps](#A_Skeleton_for_3D_Apps)<br>[Demos](#Demos)<br>&nbsp;&nbsp;[Simple Demos](#Simple_Demos)<br>&nbsp;&nbsp;[Materials](#Materials)<br>&nbsp;&nbsp;[Shapes and meshes](#Shapes_and_meshes)<br>&nbsp;&nbsp;[Paths](#Paths)<br>&nbsp;&nbsp;[Curves and Surfaces](#Curves_and_Surfaces)<br>&nbsp;&nbsp;[Textures](#Textures)<br>&nbsp;&nbsp;[Shaders](#Shaders)<br>&nbsp;&nbsp;[Particle Systems](#Particle_Systems)<br>&nbsp;&nbsp;[Loading 3D Models](#Loading_3D_Models)<br>&nbsp;&nbsp;[Selecting Objects](#Selecting_Objects)<br>&nbsp;&nbsp;[Text](#Text)<br>&nbsp;&nbsp;[Miscellaneous](#Miscellaneous)<br>[Example](#Example)<br>[History](#History)<br>&nbsp;&nbsp;[Version 2.0.0-beta2](#Version_2_0_0_beta2)<br>&nbsp;&nbsp;[Version 2.0.0-beta1:](#Version_2_0_0_beta1)<br>
2527

2628
## How to Use
2729

@@ -370,9 +372,43 @@ The following is a simple example of an HTML page that uses the HTML 3D library.
370372
</script>
371373
</body>
372374

373-
<h2>History</h2>
374-
375-
Version 2.0.0-beta1:
375+
<a id=History></a>
376+
## History
377+
378+
<a id=Version_2_0_0_beta2></a>
379+
### Version 2.0.0-beta2
380+
381+
The changes in beta 2 from beta 1 include:
382+
383+
- Added H3DU.PbrMaterial class and supported physically-based shading in the default shader.
384+
- H3DU.Shape objects contain H3DU.PbrMaterial by default.
385+
- Extras folder contains a glTF loader, which is preliminary and incomplete.
386+
- H3DU.Scene3D will create a WebGL 2 rendering context if possible and supported by the browser.
387+
- H3DU.MeshBuffer stores vertex data by semantic (such as position, normal or texture coordinates), rather than by name.
388+
- The new H3DU.Semantic class contains constants for attribute and uniform semantics.
389+
- The new H3DU.TextureInfo class is a lightweight class for storing a texture's settings, but not its data.
390+
- H3DU.ShaderInfo class can now accept H3DU.TextureInfo objects as uniform values.
391+
- H3DU.Material can accept a parameter object in the constructor as it can in the setParams method, similarly to the
392+
new H3DU.PbrMaterial class.
393+
- Added fromBasic and fromBasicTexture methods to H3DU.Material class.
394+
- Many new methods were added to the H3DU.Math class, including methods to add and
395+
subtract 4-element vectors, to clamp vectors, and to convert to and from linear RGB colors,
396+
as well as vec3proj, vec4proj, mat3invert, and vec3fromWindowPoint methods.
397+
The frustumHasBox method was improved.
398+
- The shapeCount, getShape, setShape, and copy methods were added to H3DU.ShapeGroup.
399+
- New H3DU.CubeMap class holds information on the textures that make up a cube map.
400+
However, cube maps are not yet supported in the default shader (its code is
401+
currently commented out)
402+
- In the H3DU.GraphicsPath extra, added methods for high-level shapes and path
403+
interpolation and improved code on path triangulation.
404+
- H3DU.TextFont extra supports multichannel signed distance field fonts.
405+
- Several new demos were added.
406+
- Some methods were removed: setMaterialParams methods from both H3DU.Shape and H3DU.ShapeGroup; mapTexture and mapTexturesAll methods from TextureLoader; and forShader method from H3DU.Material.
407+
- Renamed setOrientation and multOrientation in H3DU.Transform to setRotation and multRotation, and deprecated the old names.
408+
- Bug fixes.
409+
410+
<a id=Version_2_0_0_beta1></a>
411+
### Version 2.0.0-beta1:
376412

377413
- All classes in the main library are moved to a new namespace called `H3DU`. For example, `Shape` is now <a href="H3DU.Shape.md">H3DU.Shape</a> and `Mesh` is now <a href="H3DU.Mesh.md">H3DU.Mesh</a>. Many classes in the "extras" directory are also moved to the `H3DU` namespace.
378414
- `Scene3D`, now <a href="H3DU.Scene3D.md">H3DU.Scene3D</a>, is no longer meant to be a scene graph of objects to draw. That job now belongs to the new <a href="H3DU.Batch3D.md">H3DU.Batch3D</a> class. Scene3D's `render` method now takes an array of `Batch3D`s to render. For compatibility, though, the methods allowing it to manage 3D models and the coordinate system, such as `makeShape` and `setPerspective`, can still be used until `H3DU.Scene3D` renders a custom `H3DU.Batch3D`. This compatibility behavior may be dropped in the future.
@@ -402,7 +438,7 @@ Version 2.0.0-beta1:
402438
polygons. Path triangulation now supports polygons with holes.
403439
- The default light configuration is no lights when creating a <a href="H3DU.LightSource.md">H3DU.LightSource</a>. The exception, for compatibility purposes, is when using a <a href="H3DU.Scene3D.md">H3DU.Scene3D</a> without rendering a custom `Batch3D`, in which case the default is one light source with its default values.
404440
- The default value for specular materials (<a href="H3DU.Material.md">H3DU.Material</a>) is now (0.1, 0.1, 0.1). The default value for shininess is now 32.
405-
- The Mesh class no longer supports multiple primitive types (lines, triangles, points). Using different modes that use the same primitive type (for example, TRIANGLE_FAN and QUAD_STRIP) in the same mesh is still supported.
441+
- The Mesh class no longer supports multiple primitive types (lines, triangles, points). Using different modes that use the same primitive type (for example, `TRIANGLE_FAN` and `QUAD_STRIP`) in the same mesh is still supported.
406442
- Many of the tutorials were edited heavily to accommodate the new version. The `GraphicsPath` tutorial was added.
407443
- There were also numerous bug fixes.
408444
- A known issue: When using the <a href="H3DU.Camera.md">H3DU.Camera</a> in conjunction with the compatibility behavior of <a href="H3DU.Scene3D.md">H3DU.Scene3D</a>, only one side of the scene will appear lighted by default.

extras/text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ H3DU.TextFont._textShader = function(msdf) {
958958
" float dsmooth=0.06;",
959959
" float o=smoothstep(0.5-dsmooth,0.5+dsmooth,df);",
960960
"#endif",
961-
" gl_FragColor=vec4(md.rgb,pow(md.a*o,0.4545));",
961+
" gl_FragColor=vec4(md.rgb,md.a*o);",
962962
"}"].join("\n");
963963
return shader;
964964
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "html3dutil",
3-
"version": "2.0.0-beta1",
3+
"version": "2.0.0-beta2",
44
"author": {
55
"name": "Peter Occil <[email protected]>"
66
},

tutorials/history.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
<a id=Version_History></a>
22
## Version History
33

4+
Version 2.0.0-beta2:
5+
6+
The changes in beta 2 from beta 1 include:
7+
8+
- Added H3DU.PbrMaterial class and supported physically-based shading in the default shader.
9+
- H3DU.Shape objects contain H3DU.PbrMaterial by default.
10+
- Extras folder contains a glTF loader, which is preliminary and incomplete.
11+
- H3DU.Scene3D will create a WebGL 2 rendering context if possible and supported by the browser.
12+
- H3DU.MeshBuffer stores vertex data by semantic (such as position, normal or texture coordinates), rather than by name.
13+
- The new H3DU.Semantic class contains constants for attribute and uniform semantics.
14+
- The new H3DU.TextureInfo class is a lightweight class for storing a texture's settings, but not its data.
15+
- H3DU.ShaderInfo class can now accept H3DU.TextureInfo objects as uniform values.
16+
- H3DU.Material can accept a parameter object in the constructor as it can in the setParams method, similarly to the
17+
new H3DU.PbrMaterial class.
18+
- Added fromBasic and fromBasicTexture methods to H3DU.Material class.
19+
- Many new methods were added to the H3DU.Math class, including methods to add and
20+
subtract 4-element vectors, to clamp vectors, and to convert to and from linear RGB colors,
21+
as well as vec3proj, vec4proj, mat3invert, and vec3fromWindowPoint methods.
22+
The frustumHasBox method was improved.
23+
- The shapeCount, getShape, setShape, and copy methods were added to H3DU.ShapeGroup.
24+
- New H3DU.CubeMap class holds information on the textures that make up a cube map.
25+
However, cube maps are not yet supported in the default shader (its code is
26+
currently commented out)
27+
- In the H3DU.GraphicsPath extra, added methods for high-level shapes and path
28+
interpolation and improved code on path triangulation.
29+
- H3DU.TextFont extra supports multichannel signed distance field fonts.
30+
- Several new demos were added.
31+
- Some methods were removed: setMaterialParams methods from both H3DU.Shape and H3DU.ShapeGroup; mapTexture and mapTexturesAll methods from TextureLoader; forShader method from H3DU.Material.
32+
- Renamed setOrientation and multOrientation in H3DU.Transform to setRotation and multRotation, and deprecated the old names.
33+
- Bug fixes.
34+
435
Version 2.0.0-beta1:
536

637
There are many, many changes to version 2.0.0-beta1 from version 1.5.1. Here are some of them, including the most important ones.

tutorials/overview.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ The library differs from many others because this one is in the public domain, s
99

1010
This page includes information on how to use the HTML 3D library, an overview of its features, and an example of a simple 3D-enabled Web page.
1111

12+
NOTE: This section and the rest of this page will largely discuss the 2.0.0-beta2 version of the HTML 3D library, which differs considerably from the current release (version 1.5.1) of the library. (See the section "History" for more information.)
13+
1214
<a id=Example></a>
1315
## Example
1416

@@ -17,7 +19,7 @@ This page includes information on how to use the HTML 3D library, an overview of
1719
<a id=Contents></a>
1820
## Contents
1921

20-
[Public-Domain HTML 3D Library](#Public_Domain_HTML_3D_Library)<br>[Example](#Example)<br>[Contents](#Contents)<br>[How to Use](#How_to_Use)<br>&nbsp;&nbsp;[List of Classes](#List_of_Classes)<br>&nbsp;&nbsp;[`H3DU.Scene3D`](#H3DU_Scene3D)<br>&nbsp;&nbsp;[The "Camera"](#The_Camera)<br>&nbsp;&nbsp;[3D Models](#3D_Models)<br>&nbsp;&nbsp;[Shapes](#Shapes)<br>&nbsp;&nbsp;[The Render Loop](#The_Render_Loop)<br>[A Skeleton for 3D Apps](#A_Skeleton_for_3D_Apps)<br>[Demos](#Demos)<br>&nbsp;&nbsp;[Simple Demos](#Simple_Demos)<br>&nbsp;&nbsp;[Materials](#Materials)<br>&nbsp;&nbsp;[Shapes and meshes](#Shapes_and_meshes)<br>&nbsp;&nbsp;[Paths](#Paths)<br>&nbsp;&nbsp;[Curves and Surfaces](#Curves_and_Surfaces)<br>&nbsp;&nbsp;[Textures](#Textures)<br>&nbsp;&nbsp;[Shaders](#Shaders)<br>&nbsp;&nbsp;[Particle Systems](#Particle_Systems)<br>&nbsp;&nbsp;[Loading 3D Models](#Loading_3D_Models)<br>&nbsp;&nbsp;[Selecting Objects](#Selecting_Objects)<br>&nbsp;&nbsp;[Text](#Text)<br>&nbsp;&nbsp;[Miscellaneous](#Miscellaneous)<br>[Example](#Example)<br>
22+
[Public-Domain HTML 3D Library](#Public_Domain_HTML_3D_Library)<br>[Example](#Example)<br>[Contents](#Contents)<br>[How to Use](#How_to_Use)<br>&nbsp;&nbsp;[List of Classes](#List_of_Classes)<br>&nbsp;&nbsp;[`H3DU.Scene3D`](#H3DU_Scene3D)<br>&nbsp;&nbsp;[The "Camera"](#The_Camera)<br>&nbsp;&nbsp;[3D Models](#3D_Models)<br>&nbsp;&nbsp;[Shapes](#Shapes)<br>&nbsp;&nbsp;[The Render Loop](#The_Render_Loop)<br>[A Skeleton for 3D Apps](#A_Skeleton_for_3D_Apps)<br>[Demos](#Demos)<br>&nbsp;&nbsp;[Simple Demos](#Simple_Demos)<br>&nbsp;&nbsp;[Materials](#Materials)<br>&nbsp;&nbsp;[Shapes and meshes](#Shapes_and_meshes)<br>&nbsp;&nbsp;[Paths](#Paths)<br>&nbsp;&nbsp;[Curves and Surfaces](#Curves_and_Surfaces)<br>&nbsp;&nbsp;[Textures](#Textures)<br>&nbsp;&nbsp;[Shaders](#Shaders)<br>&nbsp;&nbsp;[Particle Systems](#Particle_Systems)<br>&nbsp;&nbsp;[Loading 3D Models](#Loading_3D_Models)<br>&nbsp;&nbsp;[Selecting Objects](#Selecting_Objects)<br>&nbsp;&nbsp;[Text](#Text)<br>&nbsp;&nbsp;[Miscellaneous](#Miscellaneous)<br>[Example](#Example)<br>[History](#History)<br>&nbsp;&nbsp;[Version 2.0.0-beta2](#Version_2_0_0_beta2)<br>&nbsp;&nbsp;[Version 2.0.0-beta1:](#Version_2_0_0_beta1)<br>
2123

2224
## How to Use
2325

@@ -366,9 +368,43 @@ The following is a simple example of an HTML page that uses the HTML 3D library.
366368
</script>
367369
</body>
368370

369-
<h2>History</h2>
370-
371-
Version 2.0.0-beta1:
371+
<a id=History></a>
372+
## History
373+
374+
<a id=Version_2_0_0_beta2></a>
375+
### Version 2.0.0-beta2
376+
377+
The changes in beta 2 from beta 1 include:
378+
379+
- Added H3DU.PbrMaterial class and supported physically-based shading in the default shader.
380+
- H3DU.Shape objects contain H3DU.PbrMaterial by default.
381+
- Extras folder contains a glTF loader, which is preliminary and incomplete.
382+
- H3DU.Scene3D will create a WebGL 2 rendering context if possible and supported by the browser.
383+
- H3DU.MeshBuffer stores vertex data by semantic (such as position, normal or texture coordinates), rather than by name.
384+
- The new H3DU.Semantic class contains constants for attribute and uniform semantics.
385+
- The new H3DU.TextureInfo class is a lightweight class for storing a texture's settings, but not its data.
386+
- H3DU.ShaderInfo class can now accept H3DU.TextureInfo objects as uniform values.
387+
- H3DU.Material can accept a parameter object in the constructor as it can in the setParams method, similarly to the
388+
new H3DU.PbrMaterial class.
389+
- Added fromBasic and fromBasicTexture methods to H3DU.Material class.
390+
- Many new methods were added to the H3DU.Math class, including methods to add and
391+
subtract 4-element vectors, to clamp vectors, and to convert to and from linear RGB colors,
392+
as well as vec3proj, vec4proj, mat3invert, and vec3fromWindowPoint methods.
393+
The frustumHasBox method was improved.
394+
- The shapeCount, getShape, setShape, and copy methods were added to H3DU.ShapeGroup.
395+
- New H3DU.CubeMap class holds information on the textures that make up a cube map.
396+
However, cube maps are not yet supported in the default shader (its code is
397+
currently commented out)
398+
- In the H3DU.GraphicsPath extra, added methods for high-level shapes and path
399+
interpolation and improved code on path triangulation.
400+
- H3DU.TextFont extra supports multichannel signed distance field fonts.
401+
- Several new demos were added.
402+
- Some methods were removed: setMaterialParams methods from both H3DU.Shape and H3DU.ShapeGroup; mapTexture and mapTexturesAll methods from TextureLoader; and forShader method from H3DU.Material.
403+
- Renamed setOrientation and multOrientation in H3DU.Transform to setRotation and multRotation, and deprecated the old names.
404+
- Bug fixes.
405+
406+
<a id=Version_2_0_0_beta1></a>
407+
### Version 2.0.0-beta1:
372408

373409
- All classes in the main library are moved to a new namespace called `H3DU`. For example, `Shape` is now {@link H3DU.Shape} and `Mesh` is now {@link H3DU.Mesh}. Many classes in the "extras" directory are also moved to the `H3DU` namespace.
374410
- `Scene3D`, now {@link H3DU.Scene3D}, is no longer meant to be a scene graph of objects to draw. That job now belongs to the new {@link H3DU.Batch3D} class. Scene3D's `render` method now takes an array of `Batch3D`s to render. For compatibility, though, the methods allowing it to manage 3D models and the coordinate system, such as `makeShape` and `setPerspective`, can still be used until `H3DU.Scene3D` renders a custom `H3DU.Batch3D`. This compatibility behavior may be dropped in the future.
@@ -398,7 +434,7 @@ Version 2.0.0-beta1:
398434
polygons. Path triangulation now supports polygons with holes.
399435
- The default light configuration is no lights when creating a {@link H3DU.LightSource}. The exception, for compatibility purposes, is when using a {@link H3DU.Scene3D} without rendering a custom `Batch3D`, in which case the default is one light source with its default values.
400436
- The default value for specular materials ({@link H3DU.Material}) is now (0.1, 0.1, 0.1). The default value for shininess is now 32.
401-
- The Mesh class no longer supports multiple primitive types (lines, triangles, points). Using different modes that use the same primitive type (for example, TRIANGLE_FAN and QUAD_STRIP) in the same mesh is still supported.
437+
- The Mesh class no longer supports multiple primitive types (lines, triangles, points). Using different modes that use the same primitive type (for example, `TRIANGLE_FAN` and `QUAD_STRIP`) in the same mesh is still supported.
402438
- Many of the tutorials were edited heavily to accommodate the new version. The `GraphicsPath` tutorial was added.
403439
- There were also numerous bug fixes.
404440
- A known issue: When using the {@link H3DU.Camera} in conjunction with the compatibility behavior of {@link H3DU.Scene3D}, only one side of the scene will appear lighted by default.

0 commit comments

Comments
 (0)