Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Decals Working in the Editor

Sign in to follow this  


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


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  


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
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!