Jump to content

Recommended Posts

Posted

To get you started: use a blue material (mode alpha) and some simple fragment-shader like this:

 

#version 400
//Uniforms
uniform sampler2D texture0;
uniform vec4 materialcolordiffuse;
uniform float currenttime;
//Inputs
in vec4 ex_color;
in vec2 texcoords0;
in float clipdistance0;
//Outputs
out vec4 fragData0;
void main()
{
//Clip plane discard
if (clipdistance0>0.0) discard;

fragData0 = ex_color * materialcolordiffuse;
fragData0.rgb += .2*sin(tan(texcoords0.y-currenttime*.008)*10)+.25;
fragData0.a = .5;
}

 

This does in fact look horrible. You will need some (maybe even a lot of) fine-tuning of the parameters, but it should give you an impression, how to create that flickering look.

Posted

Hi

Thanks

I not a coder

But I can't get this to work, when you run it there is nothing there but it's shadow, you can see something when you shine the torch on it but it's not looking like a hologram, just some sort of shadow

Posted

Hi

Thanks

I not a coder

But I can't get this to work, when you run it there is nothing there but it's shadow, you can see something when you shine the torch on it but it's not looking like a hologram, just some sort of shadow

Make sure this code goes in the fragment, not the vertex (there is a dropdown at the bottom).

Posted

Do I put the shader in Post Effects in the Root or some were als?

If I put it in Root the perspective screen it freezes it, can move the other screens but not the one

Posted

No, this is NOT a postprocessing-shader. This is a material-fragment-shader. To apply it do the following:

  1. Open up the material-editor for your hologram's material
     
  2. Set the Blend Mode to "alpha" and the diffuse color to some nice blue
     
  3. Go to the shaders-tab
     
  4. As the shader choose the one attached to this post (you should rename it to have ".shader" in the end, instead of ".txt"). The attached one has its vertex-shader and its fragment-shader already set (as they always have to fit together), so you don't have to do that anymore.

hologram.txt

Posted

Hi

Thanks mate that is working

The only thing is I make a nice blue diffuse colour wen I add the shader it turns red? lol

 

Is there an order you do it in?

Posted

There is blue in the hologram but there a lot of red as well

Tried different orders of entering (shader, colour then alpha (so on )

No differences, still red shows up

Posted

That's just in the editor. Try pressing the start-button and view it in-game. Then it shouldn't be red anymore.

 

I edited my post above to point to the shader-file that should look correct in the editor, as well.

  • Upvote 1
Posted

I was viewing in-game (Run Game)

 

hmm, strange, but if it works now, that doesn't matter...

 

Is there a way of slowing down the flicker?

 

With a bit of maths you can do anything wink.png. You will have to modify the shader:

Open up the shader in the shader editor (you can do so by clicking the icon with the pen in the material editor).

Make sure, you are editing the fragment shader (there is a selection box where you can switch between vertex/geometry/control/evaluation/fragment).

You should see the code I posted above (with a slight modification).

 

All the magic happens in this line:

fragData0.rgb += .2*sin(tan(texcoords0.y-currenttime*.008)*10)+.25

 

if you change the factor after currenttime (0.008), you can influence the speed. Just play around with the values there. If you e.g. want to have a regular pattern instead, you could also go ahead and just remove the "tan".

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...