Welcome, Guest

Author Topic: Emissive HUD?  (Read 156 times)

jvukovich

  • Posts: 33
    • View Profile
Emissive HUD?
« on: March 18, 2017, 12:41:14 PM »
I am trying to figure out how to make my HUD view emit emissive light. Kind of like this:

http://imgur.com/xySjpZJ

I didn't see anything in the documentation or tutorials on how to achieve this. Any pointers/tips?

Thanks!

jvukovich

  • Posts: 33
    • View Profile
Re: Emissive HUD?
« Reply #1 on: April 08, 2017, 01:54:45 PM »
*bump*

Is this not possible?

George

  • Administrator
  • *****
  • Posts: 15
    • View Profile
Re: Emissive HUD?
« Reply #2 on: April 12, 2017, 09:03:23 AM »
Hi jvukovich,

This is possible and relatively easy. There are two approaches.

First - the SDK returns a texture and you can apply additional glow shader before/during using it on a specific surface. There are many examples in the internet for glow/bloom shaders, and it would depend on the engine and graphics API you are using, but here is one sample -https://learnopengl.com/#!Advanced-Lighting/Bloom.

The second approach is to use CSS - I'm linking directly a sample I've found - http://codepen.io/FelixRilling/pen/qzfoc that works in any browser.

Hope that helps,
George

jvukovich

  • Posts: 33
    • View Profile
Re: Emissive HUD?
« Reply #3 on: April 20, 2017, 07:48:43 PM »
Thanks George. Haha, that CSS one is the first one I tried. :) It seems promising, but when trying it, doesn't quite look right.

Thanks for the shader piece. I am using UE4. Is it possible to apply the shader to the HUD view rather than the texture for surfaces? (also, I am using GT, not UI if that makes any difference)
« Last Edit: April 20, 2017, 07:50:28 PM by jvukovich »

john.v

  • Administrator
  • *****
  • Posts: 43
    • View Profile
Re: Emissive HUD?
« Reply #4 on: April 26, 2017, 10:58:22 AM »
Hi jvukovich,

You may achieve this effect in your HUD by defining a custom effect filter in your backend and applying it to the elements of your HUD, as described in our documentation - http://coherent-labs.com/Documentation/cpp-gt/d7/d18/filters.html.

In order to implement your own filter, you may follow the walk-through of our Native Custom filters sample - http://coherent-labs.com/Documentation/cpp-gt/d4/dd1/samplefilters.html. The steps you have to go through are the following:

1) Create a custom pixel shader that creates an emissive effect, compile it and regenerate its header file.

2) Implement a DrawCustomEffect method in your backend;

3) Handle the BC_DrawCustomEffect command by adding the following code in FCohRenoirBackend::ExecuteRendering

Code: [Select]
case BC_DrawCustomEffect:
{
const auto Command = reinterpret_cast<const DrawCustomEffectCmd*>((const char*)Buffer.Commands + Offset.Offset);
DrawCustomEffect(Command);
}

4) In the DrawCustomEffect method, substitute the pixel shader for your custom one;

5) Call DrawIndexed(Command) to draw the elements;

John V.
Support Engineer at Coherent Labs


jvukovich

  • Posts: 33
    • View Profile
Re: Emissive HUD?
« Reply #5 on: April 27, 2017, 10:39:52 PM »
Awesome, thank you!

Tags: