0

There are multiple rings on the screen as shown. enter image description here The requirement says that the user can select any of the rings and the selected ring should undergo glow effect(glow for few seconds then become green).enter image description here All graphics rendering is to be done using DirectX 9 + HLSL. The problems I am facing :

  • How to differentiate the selected ring from the others in the shader code so that glow effect can be applied to that ring only.
proton
  • 658
  • 1
  • 7
  • 26

2 Answers2

1

You should work with different rendertargets (Documentation of SetRenderTarget). First you render all not-selected rings to the backbuffer. Then you draw the selected ring to an extra texture as a rendertarget. Your glowshader make this texture glowing and finally you render the texture to the backbuffer. So your green ring is glowing and the others aren't effected by the glowshader.

Gnietschow
  • 3,070
  • 1
  • 18
  • 28
  • Started implementing a test sample. Need good algorithm/links/code sources for **glowshader**. – proton Dec 03 '12 at 08:50
  • @ppu: http://http.developer.nvidia.com/GPUGems/gpugems_ch21.html, but maybe a glowshader for this purpose is a little bit overkill. How about a textured line with a glowy texture? Thats simpler and would achieve the same result. – Gnietschow Dec 03 '12 at 09:36
  • I am a bit confused.I will render the red line on backbuffer_1, then render the line with glow effect on backbuffer_2. How to merge both of them in a single frame ? I am using only vertices info and no texture coordinates for the lines. – proton Dec 30 '12 at 15:43
  • Your render a fullscreen quad onto backbuffer_1 and take backbuffer_2 as texture for the quad. You should use ADD for the blending operator. – Gnietschow Dec 30 '12 at 17:29
0

If you want to have glowing lines and don't use the glowshader for anything else you could make your lines glowy with a "thick" line and a appropiate texture as in following picture:

Methode

That would be much easiert to implement and much faster then the other approach :)

Gnietschow
  • 3,070
  • 1
  • 18
  • 28
  • :Tried to implement the blur shader using various references for Gaussian blur, but the merging of vertical and horizontal blur is not happening in multiple passes in the shader code.Then took 2 backbuffers and tried to use them as 2 textures one blurred horizontally other blurred vertically still merging the two in final output is not proper.Need some reference to merge to textures post processing. I cannot use any texture resources.Need effect like this one [Dx10 Glow](http://www.codeproject.com/Articles/156323/Stencil-Buffer-Glows-Part-2) in DirectX9.Badly confused. – proton Jan 03 '13 at 19:59
  • I implemented a blureffect with 2 textures and alternating horizontal and vertical blur and the rendertargets like 1. Render to texture 1 with scenetexture horizontal blurring 2. render to texture 2 with texture 1 vertical blurring 3. like 1. but with texture 2 and so on – Gnietschow Jan 04 '13 at 13:23