查看: 1567|回复: 1
打印 上一主题 下一主题

灯光材质贴图教程(英文)

[复制链接]

9210

主题

1

听众

5万

积分

内部人员

Rank: 7Rank: 7Rank: 7

纳金币
12582
精华
186

活跃会员

跳转到指定楼层
楼主
发表于 2013-4-15 17:47:49 |只看该作者 |倒序浏览

This technique has nothing to do with per-pixel shading but it can be a valuable addition to per-pixel shaded scenes. First download the model '4Rooms.lwo'. Start Quest3D professional and select ‘Import...’ from the file menu. select the model you just downloaded.


Next, select the object that you have imported (4rooms.lwo). Press the tool button that is labeled 'Lightmap model' (tool buttons have little hammer icon displayed next to them). A dialog will pop up, requesting you for a resolution for the maps. The largest surface in the model will get the resolution you typed in. All other surfaces will get a texture size that is scaled accordingly. Enter 128 as the maximum texture size and press ok.


The tool created a new channel group with the mapped object in it. You can switch to the new group by clicking the 'Groups' tab at the top left of the screen. The group is labeled '4Rooms.Lwo Lightmap'. You can view the group in the channel graph by dragging the name of the group into the graph. You can view the object by switching to the object section (F4) and selecting the object in the object list.


As you can see the model has been remapped and a green grid texture has been applied. Go back to the channels section and select the 'Templates' tab at the top left of the screen. Drag the template labeled 'Camera, Light, Object, Fullscreen' from the 'Quickstart' template folder. select the channel that is labeled 3D Text Object and the two folders that are attached to it. Press the Delete key to delete them.


Link the channel that is labeled '4Rooms.lwo' to the channel that is labeled 'DX8 3D Render' by dragging a line from the black square at the top of the object to the 'DX8 3D Render' channel. Move the mouse cursor over the channel at the top of the graph and press the right mouse button. select 'Set As start channel' from the menu that pops up. In the picture you see that all surfaces and the motion of the object have been put into a folder. You can do this by selecting items and pressing the space bar. To unpack a folder, select a single folder and press the space bar again.


Press F4 or select 'Animation' from the 'Sections' menu to go to the animation section. Make sure the fist button on the toolbar is selected to verify that the view is in perspective mode (orbit cam). You can orbit the 3D scene by holding the Alt key in combination with the left mouse button. You can zoom in and out by pressing the right mouse button or using the scroll wheel. With the shift key you can move the center point of the view.


Currently, there is only one light in the scene. You could add more lights or change the position of the current light but the single light we have now should do for now. Go to the object section (F4) and select the 'Texture Lighting' tab. Make sure you have selected the object and press the 'select all surfaces' button. Now press the 'Calculate Lighting' button to render the light maps.


The light maps clearly show 'jaggies' at the edges of the shadows. To solve this we are going to make the texture size a bit smaller and use anti aliasing. Enter 64 in the width box of the texture settings and press the 'Set Relative' button to change the size of all the textures. Next, set the anti aliasing option to 16x and make sure the 'Soft Shadows' box is checked. Press the 'Calculate Lighting' button to render the light maps with the new settings.


It's also possible to change the settings for a single or any number of surfaces. select the floor of the room that is pictured at the right of the previous image by clicking once in the 3D view. Enter 64 in the 'Textures settings, Width' box and press the 'Set Relative' button to change the texture size for the floor. Set anti aliasing to 64x and hit the 'Calculate Lighting'. You can use this method to add more detail in light maps where you need it. You can press and hold the ESC key to abort a calculation.


Go to the animation section(F3). select the 'Light' tab and click on the color box. This allows you to change the color of the light. After changing the color, enter 0.05 in the 'Falloff square' box. This makes the light less intense over distance. You can click in the 3D window and drag the position of the light if you want. Go back to the object section (F4) and hit the 'Calculate Lighting' button to see the result of your changes. You can set anti aliasing to 1x to reduce the render time.




If you go back to the animation section again and select the 'Light' tab, you can press the 'Add light' button to add a light to the scene. You can choose between directional, spot and point lights. If you are lighting an indoor environment like this you should limit yourself to spotlights and point lights. After adding and moving some lights, you can press F4 to go back to the object section and calculate the new light maps. In the actual end result that can be downloaded we've added the "walkthrough" QuickStart template to create a simpel walkthrough demo.
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

手机版|纳金网 ( 闽ICP备2021016425号-2/3

GMT+8, 2024-11-23 20:49 , Processed in 0.088423 second(s), 31 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部