Documentation for screenshots fails to relay basic info

So it starts off saying their are two functions , but doesnt say why ?

What does “CreateScreenshotUsingRenderTarget” do that “CreateScreenshot” does not…

post effects related?

Then it proceeds to give an example of the latter saying it wont work as expected , then shows another snippet of code to make it work but then again, says it will probably not be good enough for more complex scenes , makes mention of “timers and actions” with zero elaboration or examples of those.

Also , for the life of me how must we guess where this is in NPM… such info is needed in the documentation

you guys need some system for this , I personally believe documentation page HAS to have :

• A link to the API code ( and the API code should link to the repository if you really want to be the best in the whole wide world )

• The NPM address.

Consider me the perfect example of how the documentation is failing in this regard :wink:

Thanks for the suggestions.

AFAICT the screenshot tools are in the core Babylon.js NPM package.

I understand it can be frustrating when the information you need is not clear in the documentation, but we are always trying our best to improve, so please keep that in mind :slight_smile: The documentation page for screenshots looks to be quite old, so we can certainly go through it again. I created an issue so we can prioritize it: Update CreateScreenshot docs page · Issue #841 · BabylonJS/Documentation (github.com)

The API docs aren’t directly linked, but if you search for the function name they are easily found: Tools | Babylon.js Documentation (babylonjs.com). They are automatically generated from the code and comments. The repo is also publically accessible, and Github has a code search function where you can also search for the name of the function. @RaananW do you think we should link the API docs and code search in the repo? Something like a button besides each attribute/method where clicking leads to a code search on the repo with that name.

1 Like

We are continously working on improving the docs and the way we are delivering features.
Whereas I agree that we can do better, this will take a little while until we fully fix that. We had an idea to move the documentation to the main mono-repo, which will allow us to generating docs to both the UMD and the ES6 version. we are aware of the issues, we hope we provide good support on the forum, and hope that our users are always able to run a quick search on our github if they are really lost. And again - this is in the works, but will require patience :slight_smile:

3 Likes

Also keep in mind that Babylon is a free open source project (including the doc) and it is totally fine to help improving the documentation with some PRs

3 Likes

yes i fully understand but i believe the linking features I mentioned would be handled by some clever automation down the line , not many manual updates obviously, that would be impossible to maintain.

For the “timers and actions” mentioned , I could not help either because I dont actually know how to do it. How does the timer work in relation to the scene rendering? Whoever wrote that part of the docs has all the secrets :wink:

All that said , you have a very valid point in that I should learn about how to contribute to the docs so I can help make improvements and not only complain about stuff.

hehe , yes i found it … in a directory named ‘Misc’

yes , i found that one es6 page in the docs :
#installing-other-babylon-modules

that has this info :
> * screenshot support can be found in the Misc/screenshotTools .

and had a look inside and then derived i needed :
import {CreateScreenshot} from "@babylonjs/core/Misc/screenshotTools";

The linking to the repo from the API docs idea is something Ive actually worked with when using and learning the Laravel framework a few years back , it was extremely helpful.

@carolhmj I thought of searching the repo , I actually went there but didnt see the search functionality , how do you search a repo , im even looking at one of my own repo’s now to see if I seea search box and I dont…?

VSC is also not helpful here since the search doesnt return results from the modules directory either…

So I was manually digging around trying to find it and I guess thats where I thought to myself it would be nice if it was just in the docs or api etc…

oh yeah of course. I was not complaining at all:) Please send feedback along