Sign in to follow this  
xissburg

How to...do these effects?

Recommended Posts

xissburg    204
look this(NFSU): I have some questions ;) 1)How to do these marks the tyre leaves on the ground?!? 2)How to make the painted lines on the asphalt? 3)How to get these lighting effects?!? about 1 and 2, I ve heard about a method where you create textured planes and put them over the asphalt(they'll be coplanar with the asphalt) and then using the render state D3DRS_ZBIAS you control what must be rendered over what. So the textured planes will be redered over the street. I never used this method and I'm not sure if this is the one used on the commecial games. Thanks for reading...and thanks for replying :)

Share this post


Link to post
Share on other sites
frob    44973
Quote:
Original post by xissburg
1)How to do these marks the tyre leaves on the ground?!?
2)How to make the painted lines on the asphalt?
3)How to get these lighting effects?!?

about 1 and 2, I ve heard about a method where you create textured planes and put them over the asphalt(they'll be coplanar with the asphalt) and then using the render state D3DRS_ZBIAS you control what must be rendered over what. So the textured planes will be redered over the street. I never used this method and I'm not sure if this is the one used on the commecial games.

Thanks for reading...and thanks for replying :)

1) There are many different ways to do it. For a beginner the easiest would probably be with simple multitexturing.

2) Which painted lines? I'm guessing that they are just part of the asphalt's textures.

3) There are a lot of different lighting effects in that scene, any one in particular you are intested in?

Share this post


Link to post
Share on other sites
Armadon    1091
Quote:
1)How to do these marks the tyre leaves on the ground?!?

These are called decals.
From the DirectX SDK documentation
"Direct3D applications use decaling to control which pixels from a particular primitive image are drawn to the rendering target surface. Applications apply decals to the images of primitives to enable coplanar polygons to render correctly.

For instance, when applying tire marks and yellow lines to a roadway, the markings should appear directly on top of the road. However, the z values of the markings and the road are the same. Therefore, the depth buffer might not produce a clean separation between the two. Some pixels in the back primitive may be rendered on top of the front primitive and vice versa. The resulting image appears to shimmer from frame to frame. This effect is called z-fighting> or flimmering.

To solve this problem, use a stencil to mask the section of the back primitive where the decal will appear. Turn off z-buffering and render the image of the front primitive into the masked-off area of the render-target surface.

Although multiple texture blending can be used to solve this problem, doing so limits the number of other special effects that your application can produce. Using the stencil buffer to apply decals frees up texture blending stages for other effects.
"


Quote:
2)How to make the painted lines on the asphalt?

I would suggest using the same technique as the decals or just have a road texture and apply it to the road.

Quote:
3)How to get these lighting effects?!?

Those lights could be a simple "particle" (sprite) texture that has a color applied to them such as white and alpha blended.

I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
xelanoimis    172
1. The tire tracks can be created as dynamic geometry generated on the wheel's trajectory, coplanar with the road, and yes, commercial games use zbias to avoid z-fighting. Zbias will act as an offset in the zbuffer comparation. Those things with higher zbias values will overlapp other coplanar geometry.

2. Yelow lines are painted in road texture - they are blurry as the road.

3. The lighting you probably refer, are called coronas, or lensflares. Thay usually are painted in 2d, or in 3d, facing the camera, having a white circular gradient in the texture that is multiplied with the needed color and blended as additive. An nice effect can be obtained if they are faded (or scalled down) when the light position is obstructed by an object, and faded back when visible again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this