A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE Technical / Map Design »Question on shaders

Author Topic: Question on shaders (9 messages, Page 1 of 1)
Moderators: Dennis

Diaboy
Joined: Jan 24, 2011

A self-fulfilling prophecy of endless possibility


Posted: May 12, 2011 03:04 PM    Msg. 1 of 9       
Another 'is it possible' question;

Just mulling it over but not sure if what I have planned will work. Looking at things such as the heat display on the plasma rifle or the ammo counter on the assault rifle, I can see that it is possible to use functions to animate certain shaders. What I want to do is have a standard texture progressively disappear (much like HUD ammo counters) using an alpha, but I dunno if that will work for a plain 32bit colored texture bitmap? Are there any workarounds?

Thanks - if this makes no sense, just say and I will post pics.

EDIT
Another way of putting this is that certain parts of a given weapon are UV'ed to a texture map, and parts of it disappear as the ammo is used up, if that makes sense.
Edited by Diaboy on May 12, 2011 at 03:06 PM


Diaboy
Joined: Jan 24, 2011

A self-fulfilling prophecy of endless possibility


Posted: May 13, 2011 10:51 PM    Msg. 2 of 9       
Yeah, I'm hoping I can get it to work...!

Just wasn't sure how. I went off a hunch and made a file, probably a gross misallocation of bitmap space, but below is a texture containing 60 images of the faces of bullets to go into the magazine of the SMG. There is also an alpha that goes with it that has each of the bullets set to a gradient (exactly the same way you'd set up the ammo counters for the HUD)



I just wanted to check that I could go about what I am trying to achieve - ammo disappearing as it is used - in this manner, or if I will need to try something else.

I was thinking the shader_transparent__meter might be what I wanted, but that seems mostly for the holographic bits and bobs. In all honesty I haven't really tried anything yet, but shaders still leave me scratching my head at times.


Diaboy
Joined: Jan 24, 2011

A self-fulfilling prophecy of endless possibility


Posted: May 14, 2011 05:41 PM    Msg. 3 of 9       
Yeah, was having a read through of your tutorial post on shaders - seems like a good place to start. I'll have a toy about with it and see what I come up with...! I'll be sure to share my results and methods.


Diaboy
Joined: Jan 24, 2011

A self-fulfilling prophecy of endless possibility


Posted: Jul 12, 2011 01:32 PM    Msg. 4 of 9       
Right, I blew some dust on this and ended up where I started really, but now I think I can get this to work.
I could use 60 different shaders for each individual bullet - however, this strikes me as being horrifically inefficient, and I'd rather not do that, just for the sake of a small detail.

The next method would be to make it animated, rather like the bolt shaders, in which the texture for the bullets is in a strip - I figured, 15 bullets in the strip and then just 4 shaders (to keep sizes in check). I have it set up like this, below:



There is a corresponding alpha too.
What I'm hoping is possible is to animate it so the texture scrolls to the left by 1/30th once per shot.


Diaboy
Joined: Jan 24, 2011

A self-fulfilling prophecy of endless possibility


Posted: Jul 12, 2011 03:14 PM    Msg. 5 of 9       
Will the scroll reset after each shot? I was hoping it would move across by a set amount and then not reset until reload...

I am currently dying of confusion - functions blehhhhh.

EDIT
The UV for the bullets sets up their texture-space on the left of the sheet, and the bullets move across to the right. The black area has a black alpha, so then each bullet should, hopefully, become transparent...


EDIT 2
Also, out of curiosity, how in the hell does the AR counter work?
Edited by Diaboy on Jul 12, 2011 at 04:38 PM


Diaboy
Joined: Jan 24, 2011

A self-fulfilling prophecy of endless possibility


Posted: Jul 12, 2011 06:42 PM    Msg. 6 of 9       
Yeah, I am having the exact issue you said - the scrolling seems to want to complete one whole cycle each time, where as I only want it to do half. I'm gonna give it one last shot and then I might just ditch the idea and use the meter shader instead, haha. I'll try and get a video in a bit.

Reason I ask about the counter is I was wondering if I can use that instead, but that might be more trouble than it's worth. I also keep only getting it to show single digits (aka. 99 instead of 19) but I can work that one out - I may have just textured incorrectly.


Jesse
Joined: Jan 18, 2009

Discord: Holy Crust#4500


Posted: Jul 12, 2011 08:07 PM    Msg. 7 of 9       
Check out the fail rod. It has a working heat meter that I'm sure could be changed to represent ammo\battery. From there you can figure out how to work a meter.


Diaboy
Joined: Jan 24, 2011

A self-fulfilling prophecy of endless possibility


Posted: Jul 12, 2011 08:14 PM    Msg. 8 of 9       
Yeah, that's where I started, but the shader_transparent_meter is more for glowing effects, I couldn't get a textured item like a casing or bullet. I have had almost complete success by using a 2048x64 texture that scrolls, with half of it being black and alpha'd out - the ammo now drains away (somewhat) convincingly, but it unfortunately is unaffected by lighting around it - so glows an unconvincing yellow. I have no idea how to stop that, more playing needed.

If I can't get it to look right, I might just do a glowing bar or dots - something like that. Will video when I can't be bothered playing anymore.

EDIT
Nope, couldn't get the glow to go away. I have recorded it and uploaded to xfire - behold!
http://www.xfire.com/video/4a39c6/
Terribly compressed, small, sound is quiet. Animations are not mine. Sorry about that. I'm not going to use this in the end anyway, the glowing is a bit annoying, but if people are interested I can upload a better video.
Edited by Diaboy on Jul 12, 2011 at 09:24 PM


Spartan314
Joined: Aug 21, 2010

Former biped rigger & FP animator


Posted: Jul 13, 2011 02:35 AM    Msg. 9 of 9       
ooo that looks pretty good. :L

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 11:30 AM 110 ms.
A Halo Maps Website