Custom lighting environments and shaders in Forge Viewer - autodesk-forge

Some models, especially ones produced through photogrammetry, don't look that good with any of the lighting presets the viewer can offer. They're often quite dark and surfaces are "shiny". What options do I have in modifying the shading? I'd just like to have a uniformly lit model.
I know I can replace the shader material on the model fragments but then I will lose the model textures. As far as I know I can't combine shaders in three.js. Is there a way to introduce my own custom lighting environment?

Unfortunately there's no official way of customizing the environment: How to add custom environment map for background in autodesk forge?.
I think you could hack your way out of this, though, for example, by switching to one of the "simpler" environment presets, and finding an angle where the photogrammetry output is lit reasonably well:
viewer.impl.matman().setEnvRotation(angle);
viewer.impl.renderer().setEnvRotation(angle);
While doing that, you could also play with the exposure settings:
viewer.impl.matman().setEnvExposure(exposure);
viewer.impl.renderer().setEnvExposure(exposure);

Related

How to change materials and textures in autodesk-forge with the same quality?

Im working with NWC models translated into SVG and i need to change the materials/textures from it. I created my own custom materiales with textures with MeshPhongMaterial but the result isnt the same because the quality is bad, i just need to replace the img texture of that material. Could you tell me what is the correct way of doing this? Thank you.
Is there any example of changing materials/textures in autodesk-forge that you con provide me?
Materials coming from SVF can be quite complex, with varying schemas. For example, the carbon fiber material in the screenshot below is loaded as a THREE.ShaderMaterial with many custom properties such as layered_anisotropy, layered_bottom_f0, layered_bottom_f0_map, or layered_diffuse.
Because of that, customization of textures of SVF materials would be very difficult unfortunately.
If the quality of the custom THREE.MeshPhongMaterial is not sufficient, I'd suggest tweaking some of its parameters, for example, adding an environment map (see an example).

Cesiumjs Particle System Blending

I feel like this is a fairly basic question, but i haven't found any real information online. how can i set the blending state to additive for a cesium particle system for an effect such as fire, etc?
Unfortunately it's not available in the current version.
Particle systems in Cesium are implemented as collections of Billboards, and currently the Billboard system is hard-coded to always use alpha blending. It would be a great feature to add though, but it would take some plumbing work to make an option for additive-blended billboards, and then another option for additive-blended particle systems that call for additive billboards. Both would be useful in their own right.

TweenEngine library vs libGDX Interpolation class

I'm developing a game based on the libGDX framework in eclipse that will have smoothly movements between my entities, so for that, I have used TweenEngine (and it is working nice), but recently I found that libGDX have its own class for interpolations.
I know both are for tweening (or for nice and smoothly animations), and I just want to know if there are technical difference or limitations between this 2 options basically because if both are the same, I would opt for the second one since it is already inside libGDX.
From one side there's generally better to use included tools because of integration and final application size (not saying of setting up the environment or exporting project problems).
On the other hand please notice that Libgdx Interpolation starts to be useful only when you are using it with Scene2D actions. And here is the problem in my opinion because you must implement stage and actors mechanisms - which is good idea by itelf but can be almost impossible if you have created almost whole application without it.
Then I would recommend you:
choose Scene2D actions + Interpolation easing if you are able to implement Scene2D in your project and the easing actions are only reason you want to use Tween Engine
choose Universal Tween Engine if you want to stay independent of new machanisms and use Sprites etc in traditional way

3d objects in actionscript 3 without plugins

I am fairly new to actionscript and was wondering is it possible to create 3d shapes (cones, spheres, cubes) using actionscript.
I would like not to have to use a plugin.
The shapes must be 3d as I need to rotate them.
Here you will find Adobes documentation for what you are looking for:
http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS7D38179D-58B9-409c-9E5C-257DDECB1A02.html
Is there any specific reason that you don't want to use 3D libraries like away3D?
I think Matej's answer does not fully cover the topic as the link he gave only describes a classic display list approach to drawing 3D objects. Depending on your needs, drawing things using classic display list can be slow, as it is not GPU accelerated. If you want to utilize your GPU you can use Stage3D APIs - that does not require any external frameworks. Here's an excellent article for starters.
And even though you can render 3D content using 'raw' Context3D, I`d recommend using a framework like Away3D or Alternativa3D. Both are open source, by the way.

Path Finding in 3d environment in Java

I understand that there are a couple of links about path finding in 2d.Is there any java example that shows how to implement path findings in 3d environment.
I have already seen lot of code and explanations about this.but none of them will really help.How to implement this in 3d enviorment
If you mean 3d pathfinding as 2d pathfinding in 3d space. For example, you have a 3d scene and something needs to find its way around the walls and rooms. If this is the case you can just make some system to keep track of all your walls (say... BSP tree?) and then implement a common pathfinding algorithm such as A*.