Forum

Scaling and antialiasing with the "full" engine

11 December 2014 04:14
Here I am again with my Java cluelessness, though at least now I know enough to ask better questions.

I already know about the anti-aliasing enable switch in the B4W addon, but is the "full" engine written in such a way that I can set the quality there? My somewhat more savvy friend/colleague tried doing so but had no luck with it. Also, how do I set the resolution and dimensions of my output? Is that also controlled by the engine, set at the time of export, or some combination of both?

Thank you for both your help and endless patience.
11 December 2014 16:05
Hi,

Here I am again with my Java cluelessness
JavaScript actually. A bit different thing.

…is the "full" engine written in such a way that I can set the quality there?
Most of the configuration parameters could be set with a help of auxiliary addon app.js. If you want to set antialiasing during initialization you need to set quality profile to CUSTOM. It should look like this:
var m_cfg = require("config");
m_app.init({
    quality: m_cfg.P_CUSTOM,
    antialiasing: false
});

Also, how do I set the resolution and dimensions of my output? Is that also controlled by the engine, set at the time of export, or some combination of both?
For now we don't allow resolution changes from API. This part of our engine will be rewritten in nearest future and programmers will have better flexibility customizing params.
As for "dimensions". Probably you meant physical size of the window in which your application is operating in. If so - this is a resolution of the canvas html element. It can be set like this:
<iframe width="800" height="500" allowfullscreen src="/tutorials/examples/web_page_integration/apple.html"></iframe>

Tutorial on this stuff can be found here
12 December 2014 06:28

Ответ на сообщение пользователя Evgeny Rodygin
JavaScript actually. A bit different thing.

Sorry, my brain was tired

Continuing with my education - where and what are the boolean switches for antialiasing referred to in the B4W documentation? Are they set from within Blender or with Javascript? What value would I be entering/coding for? Thanks.


12 December 2014 15:14
Hey,

the app.js addon is included into the "full" build, as well as other addons. That's why it is called "full"

So you can simply import the app module and use it for initialization:

var m_app = require("app");
m_app.init({
    quality: m_cfg.P_CUSTOM, // indicate that you want to use your own quality profile
    antialiasing: false // this disables anti-aliasing
})


The Founder | Twitter | Facebook | Linkedin
12 December 2014 15:24
Initialization options are listed here
Configurable parameters can be found here
The Founder | Twitter | Facebook | Linkedin
 
Please register or log in to leave a reply.