Twaver3d Special effects High Light reflection

Source: Internet
Author: User

In the previous chapter we introduced the Twaver 3D environment mapping effect, we will then share the highlight effect.
Specular reflection defines an area on an object that is more reflective than anywhere else. In specular-reflective maps, the reflectivity of the black area is 0 (completely non-reflective) and the reflectance in the white area is 100% (fully reflective). In real life, it is also ubiquitous, such as a rusty object with low light, and a polished metal should use high-strength light; the watch's dial should be more reflective than the strap, and the lips should have a stronger light than the skin, and the skin should be more reflective than a cotton dress. With this high-gloss effect, the 3D object is more realistic and more vivid.
Let's take a look at how to use specular reflection in a model, such as the building where we need to create a building. A cube can be modeled by pasting a map of the building. We have prepared a map of the glass:

Create the building code as follows:

var node = new Mono. Cube (1000,3000,1000); Node.setstyle (' M.texture.image ', './images/building.jpg '); Node.setstyle (' M.texture.repeat ') , new mono. VEC3 (2,4));

  

Next we'll prepare a high-gloss map that defines which parts of the map need to reflect the high-intensity light and which parts of the light need to be weaker.

The code is set up as follows:

Sets the color of the light that needs to be reflected, and if the setting is set to red. Node.setstyle (' m.specular ', ' white ');//Set Specular map Node.setstyle (' m.specularmap.image ', './images/specularmap.jpg ');

Then add the lighting and Skybox effects as follows:

Twaver3d Special effects High Light reflection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.