見出し画像

【How to make a world: More techniques vol.2】Emission - make objects glow

In the installation and first steps course, we've created a simple world and made it public. In the More Techniques course, we will explain how to enrich your world, such as lighting and gimmicks!
In vol.1 , we have covered the topics about colliders.

In this and the next chapter, we'll discuss "emission" and "lighting," which can dramatically change the appearance and atmosphere of the world!

* SDK version used in this article: VketCloudSDK 3.3.5


Make objects glow!

"Bloom" is a function that can make an object glow.
First of all, unlike lighting, bloom does not affect other objects even if the object emits light. Of course, it doesn't affect shadows.
Please keep in mind that this is an effect that "looks" like the object itself is emitting light .

❶ World settings

Select "WorldSetting" in the hierarchy. On the inspector will be displayed and there will be three tabs: BasicInfo, Rendering, and Avatars,
in "HEO World Setting" . Click "Rendering".

There is an item called " Bloom " in " Rendering ". When you check the box, the following two fields will appear.
🌟 Bloom Intensity : Emission intensity
🌟 Bloom Threshold : Threshold (light below this value is not affected with emission)

As an exapmle, enter Bloom Intensity: 0.3 and Bloom Threshold: 0.1 here.

❷Create materials

Next, set the material to emit light.
Please follow steps ① to ③.

① Create a new material

Select “Assets” in the project, then Right click > Create > Material to create a new material and change the name to [bloom_01].

* Click here for the article on creating a new material"

② Check "Emit" > Click HDR
Select the created material and check "Emit" in the inspector.
Then, the color information called "HDR" appears. Click on
that "HDR" .

③ Change intensity
Click "HDR" to open the HDR color window. By increasing "the strength"
in it, the intensity of the light emission changes. Let's set it around 4 for illustration.

❸Drag and drop the material onto the object

Now, let's apply the "bloom_1" material created in ❷ to the object.
Drag and drop the material of "bloom_1" to a cube in your scene.
In the below example image, there are two white cubes on a black floor.

You may not notice if it's glowing or not on Unity, but when you build it, you can see that it's emitting light. Let's build it and check it out!

❹ Build and check

Before building, let's clear the cache by pressing VketcloudSDK > Clear cache.

After clearing the cache, Click
VketcloudSDK > Build and Run .

You can see that only the cube on the right with the "bloom_1" material applied is emitting light 😊
Now, let's create a material with a slightly weaker intensity.

❺ Change the intensity of light emission and add color

First, create a new material in the same way as in step 2.
Rename it "bloom_2" and change the intensity value to "2.5".

Next, let's create a new material in the same way, name it "bloom_3"
, and change the color!
Please adjust the intensity to your liking.

Add two cubes and apply them by drag and drop.

Let's build!
Don't forget to clear your cache here.

After building, you can compare each emission.

As you can see, the boxes look different depending on the Intensity value.
It would be nice if you could make adjustments while looking at the browser display after this build.
There is a convenient way to do that!
①Turn on debug mode of WorldSetting

➁ Build and open the browser
③ Click "bloom" in the display that appears when you press the "F2" button.
This opens the debug window with the bloom value in Unity's WorldSetting.

Tweak the Bloom values on the browser after building, and find the ideal light emission. Then, enter that value in the WorldSetting on the Unity side.

This saves you the trouble of building and checking multiple times.

Where you use Bloom's effect is up to you.
Please try it right away! !

[How to make a world More Techniques vol.1] Colliders - walls, obstacles, and detections
[How to make a world More techniques vol.3] Lighting - Light settings and bake



みんなにも読んでほしいですか?

オススメした記事はフォロワーのタイムラインに表示されます!