Difference between revisions of "Tips for Verge3D devs"

From Verge3D Wiki
Jump to navigationJump to search
(35 intermediate revisions by the same user not shown)
Line 6: Line 6:
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
document.getElementsByTagName("iframe")[0].contentWindow.v3d
document.getElementsByTagName("iframe")[0].contentWindow.v3d
</syntaxhighlight>
e.g. to print performance profile from the iframe:
<syntaxhighlight lang="javascript">
document.getElementsByTagName("iframe")[0].contentWindow.v3d.apps[0].printPerformanceInfo()
</syntaxhighlight>
or to enable FPS counter:
<syntaxhighlight lang="javascript">
document.getElementsByTagName("iframe")[0].contentWindow.v3d.apps[0].showFPS()
</syntaxhighlight>
</syntaxhighlight>


Line 47: Line 59:
* FFF — show/hide '''F'''PS counter in the upper left corner of the rendered canvas.
* FFF — show/hide '''F'''PS counter in the upper left corner of the rendered canvas.
* HHH — '''h'''alt/continue application rendering.
* HHH — '''h'''alt/continue application rendering.
== Short Links ==
These short links can be very helpful for debugging mobile devices.
* [https://v3d.net/w v3d.net/w] — '''W'''ebGL System Report.
* [https://v3d.net/s v3d.net/s] — '''S'''cooter Demo.
* [https://v3d.net/r v3d.net/r] — Industrial '''R'''obot Demo.
* [https://v3d.net/1 v3d.net/1] — redirect to local App Manager (http://localhost:8668/)
* [https://v3d.net/pw v3d.net/pw] — detect GPU based on WebGL power preference.
== Supported modelling suites ==
{| class="wikitable sortable"
|-
! Suite !! Release year !! Python !! AM || Build Info / Notes
|-
| Blender 2.83 LTS || 2020 || 3.7.4 || T ||
|-
| Blender 2.90 || 2020 || 3.7.7 || T ||
|-
| Blender 2.91 || 2020 || 3.7.7 || T ||
|-
| Blender 2.92 || 2021 || 3.7.7 || T ||
|-
| Blender 2.93 LTS || 2021 || 3.9.2 || T || Dropped Windows 7 support
|-
| Blender 3.0 || 2021 || 3.9.7 || T ||
|-
| Blender 3.1 || 2022 || 3.10.2 || T ||
|-
| Blender 3.2 || 2022 || 3.10.2 || T ||
|-
| Blender 3.3 || 2022 || 3.10.2 || T ||
|-
| 3ds Max 2020 || 2019 || 2.7.15 || P || VS 2017, Platform Toolset v141, Windows SDK 10.0.17134.0
|-
| 3ds Max 2021 || 2020 || 3.7.6 || P || VS 2017, Platform Toolset v141, Windows SDK 10.0.17134.0. Dropped Windows 7-8.1 support. Arnold by default.
|-
| 3ds Max 2022 || 2021 || 3.7.9 || P || VS 2017, Platform Toolset v141, Windows SDK 10.0.17134.0
|-
| 3ds Max 2023 || 2022 || 3.9.7 || P || VS 2019, Platform Toolset v142, Windows SDK 10.0.19041.0
|-
| Maya 2019 || 2018 || 2.7.11 || P ||
|-
| Maya 2020 || 2019 || 2.7.11 || P ||
|-
| Maya 2022 || 2021 || 3.7.7 || T || Dropped Windows 7 support
|-
| Maya 2023 || 2022 || 3.9.7 || T ||
|}
== App Manager undocumented features ==
* [http://localhost:8668/get_preview_dir localhost:8668/get_preview_dir] — get path to preview directory.
* [http://localhost:8668/update_all_apps localhost:8668/update_all_apps] — update all applications automatically (use with caution!).
* [http://localhost:8668/restart localhost:8668/restart] — restart server.
* [http://localhost:8668/stop localhost:8668/stop] — stop server.
* [http://localhost:8668/reset localhost:8668/reset] — reset server settings.

Revision as of 12:20, 3 June 2022

This page contains random tips and code snippets that Verge3D devs or Verge3D DevKit users may find useful for their work.

Getting v3d namespace from iframe

document.getElementsByTagName("iframe")[0].contentWindow.v3d

e.g. to print performance profile from the iframe:

document.getElementsByTagName("iframe")[0].contentWindow.v3d.apps[0].printPerformanceInfo()

or to enable FPS counter:

document.getElementsByTagName("iframe")[0].contentWindow.v3d.apps[0].showFPS()

Debugging Verge3D render target

Use the following code to create a plane with the output of the given render target:

// DONT FORGET TO REMOVE IT!
var texture = renderTarget.texture
var geometry = new v3d.PlaneBufferGeometry(3, 3);
var material = new v3d.MeshBasicMaterial();
material.map = texture;
var planeMesh = new v3d.Mesh(geometry, material);
planeMesh.position.x = 6;
v3d.apps[0].scene.add(planeMesh);

Code Indentation Style

The K&R style, 4 spaces:

function someFun() {
    const someConst = 10;
    const alwaysTrue = true;

    for (let i = 0; i < someConst; i++) {
        if (alwaysTrue) {
            console.log(`Hello ${i}!`);
        }
    }
}

Key Triplets

There are several key triplets supported by Verge3D which are useful for debugging. To execute a triplet, wait until a Verge3D app finishes its loading, then press the same key thrice very quickly.

  • PPP — print performance profile. See here for more info.
  • FFF — show/hide FPS counter in the upper left corner of the rendered canvas.
  • HHH — halt/continue application rendering.

Short Links

These short links can be very helpful for debugging mobile devices.

Supported modelling suites

Suite Release year Python AM Build Info / Notes
Blender 2.83 LTS 2020 3.7.4 T
Blender 2.90 2020 3.7.7 T
Blender 2.91 2020 3.7.7 T
Blender 2.92 2021 3.7.7 T
Blender 2.93 LTS 2021 3.9.2 T Dropped Windows 7 support
Blender 3.0 2021 3.9.7 T
Blender 3.1 2022 3.10.2 T
Blender 3.2 2022 3.10.2 T
Blender 3.3 2022 3.10.2 T
3ds Max 2020 2019 2.7.15 P VS 2017, Platform Toolset v141, Windows SDK 10.0.17134.0
3ds Max 2021 2020 3.7.6 P VS 2017, Platform Toolset v141, Windows SDK 10.0.17134.0. Dropped Windows 7-8.1 support. Arnold by default.
3ds Max 2022 2021 3.7.9 P VS 2017, Platform Toolset v141, Windows SDK 10.0.17134.0
3ds Max 2023 2022 3.9.7 P VS 2019, Platform Toolset v142, Windows SDK 10.0.19041.0
Maya 2019 2018 2.7.11 P
Maya 2020 2019 2.7.11 P
Maya 2022 2021 3.7.7 T Dropped Windows 7 support
Maya 2023 2022 3.9.7 T

App Manager undocumented features