MadCat Posted February 21, 2016 Share Posted February 21, 2016 Hi Can you make Holograms & Holographs in Leadwerks or do you need another program? Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted February 21, 2016 Share Posted February 21, 2016 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. Quote Link to comment Share on other sites More sharing options...
MadCat Posted February 26, 2016 Author Share Posted February 26, 2016 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 Quote Link to comment Share on other sites More sharing options...
Brutile Posted February 26, 2016 Share Posted February 26, 2016 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). Quote Link to comment Share on other sites More sharing options...
MadCat Posted February 26, 2016 Author Share Posted February 26, 2016 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 Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted February 26, 2016 Share Posted February 26, 2016 No, this is NOT a postprocessing-shader. This is a material-fragment-shader. To apply it do the following: Open up the material-editor for your hologram's material Set the Blend Mode to "alpha" and the diffuse color to some nice blue Go to the shaders-tab 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 Quote Link to comment Share on other sites More sharing options...
MadCat Posted February 26, 2016 Author Share Posted February 26, 2016 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? Quote Link to comment Share on other sites More sharing options...
MadCat Posted February 26, 2016 Author Share Posted February 26, 2016 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 Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted February 27, 2016 Share Posted February 27, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted February 27, 2016 Share Posted February 27, 2016 I took the question way too literally. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
MadCat Posted February 27, 2016 Author Share Posted February 27, 2016 Hi Yep you shore did Josh lol I was viewing in-game (Run Game) I'll recopy your shader and see if it works Thanks Quote Link to comment Share on other sites More sharing options...
MadCat Posted February 27, 2016 Author Share Posted February 27, 2016 Yep it worked Thanks!! Is there a way of slowing down the flicker? Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted February 27, 2016 Share Posted February 27, 2016 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 . 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". 1 Quote Link to comment Share on other sites More sharing options...
Slastraf Posted February 27, 2016 Share Posted February 27, 2016 http://pastebin.com/BY6qkngb Above the spritesheet shader from the workshop. Make a new material with the spritesheet (best is 5x5, 4x4, etc.) Otherwise there will be artifacts. Apply the Shader on the material, the texture with alpha. 1 Quote Link to comment Share on other sites More sharing options...
MadCat Posted February 27, 2016 Author Share Posted February 27, 2016 Thanks Guys I'll give it a try Quote Link to comment Share on other sites More sharing options...
MadCat Posted February 28, 2016 Author Share Posted February 28, 2016 Hi It didn't seem to change Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.