近期热门
粉丝3
关注 0
获赞 0
HelloRacer Unity制作大概流程

[U3D] HelloRacer Unity制作大概流程

 !heats_icon! [复制链接]
8045 11 0 0 12年前 举报
转自作者博客,值得借鉴学习!

0.jpg

Our first piece for the Unity Web Player is called
HelloRacer Unity
and follows the racing tradition that started almost three years ago and still lives in my personal website carlosulloa.com.
We began playing with Unity during the summer with the intention of building iPhone apps. We released
HelloRacer iPhone
and had a lot of fun in the process, so we decided to dedicate a bit of time to the web player.
The Unity Web Player is the most powerful 3D platform we’ve worked on, and it certainly was a challenge to make good use of it. We focused our work on building a highly detailed experience, paying particular attention to the shaders and the physics.
We have found the Unity Web Player an excellent option for high-end 3D in the browser. While plug-in adoption is still very low, the quality of the experiences make installation worthwhile for most users. We don’t believe interactive 3D is just for games, as it has so much potential in other fields such as data visualization and advertising.
Shaders
1.jpg

We used separate materials for the different surfaces of the car. Body matte, body shinny, brake light, brake light glass, decals, driver, front light, interior, steering wheel, vents and windows are individually recreated with distinct textures and shaders.
While Unity comes with a great library of shaders, we chose to develop custom versions to achieve the look we wanted with a maximum performance. This approach also enabled us to create specific shaders for the reflection as simpler and faster variations of the originals.
Shader programming is incredibly powerful and gives the developer precise control of how each pixel is rendered.
We also have three shadows, one for the car and rear wheels, and a separate shadow for each front wheel. From a geometric point of view, they are planes positioned at ground level, but their texture is what makes a difference. Baked in Maya using ambient occlusion, the shadows are subtle, but serve to add depth to the scene.
Racing Physics
Unity includes the powerful PhysX physics engine, but to achieve a realistic experience you need to understand the forces involved in your simulation.
Just as it happens in real life, the weight distribution of a car determines its handling. The weight is divided between each of the four wheels, but this distribution varies as the driver accelerates, brakes and turns. For example, when braking the weight is shifted to the front wheels.
Finding the ideal center of gravity is necessary to create a realistic racing simulation. Front-heavy cars tend to understeer and rear-heavy cars to oversteer, but most important is the center of gravity height, relative to the track, that determines load transfer from side to side.
When cornering, centrifugal force acts at the center of gravity to lean the car toward the outside of the curve, increasing downward force on the outside tires. Sport car designers aim for a low center of gravity to minimize the load transfer from side to side and maximize grip.
Tyre friction and slip are another relationship to understand when adjusting vehicle dynamics. The overall friction force is usually separated into a forward component (to accelerate and brake) and a lateral component (to steer the car). In both directions, when the force acting at the tyre exceeds the grip limit, the wheel starts to spin or slide.
Since cars behave differently at different speeds, it’s necessary to monitor the vehicle’s velocity and adjust the physics parameters accordingly. A dynamic setup improves handling in a similar way as electronics are used to enhance the safety of road cars.
If you are interested in the subject, I would recommend reading the
Physics of Racing Series
by Brian Beckman. Even if you are not going to write your own racing engine, I always find very helpful to understand how it works.
0
点赞
0
打赏
0
添加到收藏夹

0

点击复制链接

使用微信扫码分享
一次扣10个券
全部评论11
您需要登录后才可以回帖 登录

多谢楼主
8年前
回复

使用道具 举报

我去 都是引文的啊
10年前
回复

使用道具 举报

{:5_197:}
10年前
回复

使用道具 举报

多谢分享
10年前
回复

使用道具 举报

{:7_267:}{:7_267:}
11年前
回复

使用道具 举报

{:7_268:}{:7_268:}{:7_268:}{:7_267:}{:7_267:}{:7_267:}
11年前
回复

使用道具 举报

好东西赞一个
11年前
回复

使用道具 举报

这效果看起来不错呀!!

11年前
回复

使用道具 举报

好东西呀!!!顶一个顶一个!!
11年前
回复

使用道具 举报

数据加载中....
没有更多评论了
您当前使用的浏览器IE内核版本过低会导致网站显示错误

请使用高速内核浏览器或其他浏览器