Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Other - [HLSL] Flashing Object with Animated Colours

Author
Message
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 6th Sep 2015 22:23
You may sometimes need to indicate something important to your players within your game world. In a 3D game world you can use a flashing indicator to attract the attention of the player. The purpose of the indicator may be to direct the player towards something, or to reveal danger.

This animated colour shader animates a given object or limb by flashing or transitioning its hue from one setting to another. Giving the appearance of a flashing object.

The shader considers the alpha channel of your colour settings, therefore with the correct transparency setting in your program, you can have the object disappear and reappear in the sequence.

The shader constants are self explanitory. Color1 and Color2 are what you need to set to determine the hue; and the AnimationSpeed constant controls the animation speed.



Login to post a reply

Server time is: 2024-04-19 19:20:27
Your offset time is: 2024-04-19 19:20:27