Sign in to follow this  
  • entries
    235
  • comments
    509
  • views
    171826

Decals Working in the Editor

Sign in to follow this  
SimmerD

104 views

Well, the decals are now officially working in the editor.

You can create, remove, size and rotate the decals, and change materials on them as well.

Here are two shots, one with one decal selected ( in blue ), and the sizing boxes displayed. The second shot is with the sizing boxes turned off.

Selected Decals

Decals

I implemented it the simple way mentioned earlier, so I don't bother tracking which decals may have changed. Instead, I just re-create each decal's tri list each frame if the decal's bbox is in the frustum, and draw it with a dynamic vertex buffer.

This way it automatically handles both cases of triangles changing and the decal box changing. It does slow down a bit in debug mode, but in release, it's just as fast, even when I scale a decal to a large size.

Of course, during the game, the only cost for a decal is one more draw call, and a frustum check, so they should be cheap enough to use all over.

I also changed the bump mapping approach. Instead of using the blue channel, which either didn't show up enough, or was too intense of a contrast, I just hardcoded a light direction in tangent space to be 'from the upper left', and that works much better. It looks better and matches what the game does.

Better Bumps

The next step is to get the decals loading in the game. Should only take an hour or two, so hopefully by later on tonight or tomorrow morning.
Sign in to follow this  


2 Comments


Recommended Comments

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