LDraw.org Discussion Forums
WebGL Model Viewer Issues - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: Administrative (https://forums.ldraw.org/forum-4.html)
+--- Forum: Website Suggestions/Requests/Discussion (https://forums.ldraw.org/forum-23.html)
+--- Thread: WebGL Model Viewer Issues (/thread-24692.html)



WebGL Model Viewer Issues - Orion Pobursky - 2021-06-18

This is a master thread for problems with the WebGL based model viewer used by both the PT and the model viewer on the main site.


RE: WebGL Model Viewer Issues - Orion Pobursky - 2022-06-01

(2021-06-18, 17:51)Orion Pobursky Wrote: This is a master thread for problems with the WebGL based model viewer used by both the PT and the model viewer on the main site.

I've noticed that there are a handful of parts on the PT that are refusing to load:
https://www.ldraw.org/cgi-bin/ptdetail.cgi?f=parts/2655.dat

Not sure if this extends to the Model Viewer. Further troubleshooting is required. If you find any others that don't load, please post them as a reply to this post.


RE: WebGL Model Viewer Issues - Orion Pobursky - 2022-06-02

(2022-06-01, 14:53)Orion Pobursky Wrote: I've noticed that there are a handful of parts on the PT that are refusing to load:
https://www.ldraw.org/cgi-bin/ptdetail.cgi?f=parts/2655.dat

Not sure if this extends to the Model Viewer. Further troubleshooting is required. If you find any others that don't load, please post them as a reply to this post.

I've fixed the issue with the above part. This has to do with the way studs are loaded in buildinginstructions.js. There may be other files with similar issues. Please report hem here if you encounter them.


RE: WebGL Model Viewer Issues - Lasse Deleuran - 2022-06-05

(2022-06-02, 1:43)Orion Pobursky Wrote: I've fixed the issue with the above part. This has to do with the way studs are loaded in buildinginstructions.js. There may be other files with similar issues. Please report hem here if you encounter them.

I went back to the documentation for this in the sample files, and found:

Code:
    <!-- buildinginstructions.js optional libraries: Generator.js for quick creation of some primitives. Required for studs.js which can create customized studs. StudioTexmap.js allows for Studio 2.0-created files -->   
    <script src="js/LDRGenerator.js"></script>
    <script src="js/LDRStuds.js"></script>
    <script src="js/StudioTexmap.js"></script>

Are you also using LDRGenerator.js? If so, then they should have worked without the fix. And in that case, there is a bug which has to be remedied.


I am currently looking into the bootstrapping of ldconfig.ldr (rather than colors.js), so I am currently working in this part of the code base.


RE: WebGL Model Viewer Issues - Orion Pobursky - 2022-06-06

(2022-06-05, 7:00)Lasse Deleuran Wrote: Are you also using LDRGenerator.js? If so, then they should have worked without the fix. And in that case, there is a bug which has to be remedied.

It's being included. Then I call:
Code:
LDR.Studs.makeGenerators('', LDR.Options.studHighContrast, LDR.Options.studLogo);

This lines up with the example code on GitHub. Is there something else that need to be called?


RE: WebGL Model Viewer Issues - Lasse Deleuran - 2022-06-06

No, that should do the trick.

My plan is to rewamp the part generation components, so that they can be more reliable and allow easier on-demand loading while using the library. That should fix this kind of issue reported here.

Right now part files from Generators and Studs are generated even though they might not be needed. I want to lazy-load all of these to improve performance. However. This requires that all generated parts correspond to the official ones, so that using the library doesn't result in inconsistencies.


RE: WebGL Model Viewer Issues - Magnus Forsberg - 2022-06-06

Here is another one that doesn't load
https://www.ldraw.org/cgi-bin/ptdetail.cgi?s=16709p0h.dat


RE: WebGL Model Viewer Issues - Orion Pobursky - 2022-06-06

(2022-06-06, 20:15)Magnus Forsberg Wrote: Here is another one that doesn't load
https://www.ldraw.org/cgi-bin/ptdetail.cgi?s=16709p0h.dat

That one loads for me. Trying hard refreshing to flush the cached Javascript.


RE: WebGL Model Viewer Issues - Magnus Forsberg - 2022-06-06

Yes, sorry.
The webGL loads, but there is no preview image in the corner and no dependencies on the part page.


RE: WebGL Model Viewer Issues - Orion Pobursky - 2022-06-06

(2022-06-06, 21:06)Magnus Forsberg Wrote: Yes, sorry.
The webGL loads, but there is no preview image in the corner and no dependencies on the part page.

Fixed