PDA

View Full Version : yes another question



paintballakid5
April 16th, 2008, 08:05 PM
Hey i'm asking another question for Gordigo because he isn't that good at translating to english... i'm kinda confused about what he's asking so heres what he typed:

"can you ask in modacity in how to make shaders with an animated plane?"

he said theyre for the animated plane on the plasma pistol and the splaser.

thanks.

Con
April 16th, 2008, 08:23 PM
isn't this something you can just learn by looking at pre-existing shaders?

wydra91
April 17th, 2008, 02:19 AM
Hmm... I suppose looking at the shader tag would help, look for animation files and learn off those. One possibility is this:

The plasma pistol might have two textures, the rainbow base texture, and a black and white animated GIF file, that serves as a sliding mask over the PNG base...

Then the GIF's frame # attribute might be linked to the temperature sig or charge sig of the pistol to achieve that real time update....

Just a guess, hope that brainstorm helped.

paintballakid5
April 24th, 2008, 01:45 PM
i guess so... but i'm not the one doing it.. it's gordigo.... so i'm not sure why hes not posting....

Gamerkd16
April 24th, 2008, 03:37 PM
How do you know what he is saying? Do you speak his language? Or are you just using a translator. And it your using a translator, there really is not a difference between him posting on here and you posting.

gordigo
April 24th, 2008, 04:49 PM
ok i will post, the question is how to make shaders with an animated plane?, and what shaders have an animated plane?

Sel
April 24th, 2008, 07:59 PM
Are you asking about an animated shader like a display, or a plane that animates?

gordigo
April 24th, 2008, 11:11 PM
i am asking about a plane that animates

OmegaDragon
April 25th, 2008, 12:21 AM
I remembering seeing something about this back in gearbox. I think scorpwanna or something like that did a tutorial on animated textures using a plane. I don't know if it is the same for weapons, but I will search for the thread.

Edit: Found it.
Original thread (http://gbxforums.gearboxsoftware.com/showthread.php?t=62792&highlight=animated+textures)
Link to tutorial (http://www.scifix.com/images/temp/animatedtextures.rar)

Contents or the .rar:
Tutorial itself w/o images
Animated Textures for Halo CE

Tutorial by Scorpwanna

Things you will need:

* Halo Custom Edition
* Halo Editing Kit
* A 3d editing program
* Imaging Program
* A model for the animated texture

The following example will be for creating a 4 image Animated Texture. Brief information about Animated Textures in Halo CE. Animated Textures are created as a type of slide show image that just moves from one side to the other using step counts. Think of the clouds sliding across the sky in a map, but in steps.

Step 1: Preparing The Model
(Note: Just for this tutorial I'm using a plane mesh, it doesn't have to be a plane. An animated texture can be applyed to any face on a model.

* Create a plane (flat) mesh in a 3d editing program. Give it one of the material textures you'll be using for the animation (just to get the size right). Name the material/texture "myanitex". Apply the material to the plane. Create a frame mesh and export the model as myanitex.JMS in: "Halo Custom Edition\data\animatedtextures\models". Tool it later.

Step 2: Setting Up The Image

* Start off by determining how many images will be in the animation. I gave this one 4 separate images at 32x32 pixels.

Each image is a pixel power of 2: 32,64,128,256 etc... In the Imaging Program create a power of 2 image palette, height 32 width 128 (32 times 4 images).

Take the first 32x32 texture in the sequence and place it as the first texture in the row you will be creating.

Take the second and place it after the first, continue until all 4 are back to back from each other.

Save this as a myanitex.tif file in your Halo CE Data folder wherever you will remember it. Some place like "Halo CE\data\animatedtextures\bitmaps" Run tool to convert the .tif into a .bitmap: tool bitmaps animatedtextures\bitmaps If successful proceed to Step 3.

Step 3: Creating The Shader

* Open Guerilla and make a new .shader_transparent_chicaco. I've read that .shader_model works too but I have yet to get one working.
o Scroll down to chicago shader in the flags section check "two-sided". Set "framebuffer blend function" to alpha-multiply add. (I set this because it makes the texture solid.)
o Scroll down to MAPS and set map u-scale to 0.25 (1/4th the width size of the 32x128 image. This tells Halo where each new texture is in the image sequence. Any image you make, be sure that you divide the width by the size of each frame added to the image sequence. If this image had 8 separate images, each frame was 32x32 and the image pixel ratio was 32x256 the number would be 0.125, 1/8th the width.)
Set map v-scale to 1.
o Scroll down to 2D Texture animation.
Set:
u-animation source: A out
u-animation period: 1 seconds
u-animation scale: 1 repeats
v-animation period: 1 seconds
v-animation scale: 1 repeats
rotation-animationperiod: 1 seconds
rotation-animation scale: 360 degrees

Save this in animatedtextures\shaders as myanitex.shader_transparent_chicago

Step 4: Exporting the Model & Creating The Tag

* Run tool to create the gbxmodel: tool model animatedtextures
* In Guerilla create a new .scenery tag.
Set:
bounding radius: 1 world units
model: animatedtextures\myanitex.gbxmodel
* Scroll down to FUNCTIONS and add an "A out"
Set:
period: 5 seconds
function: slide
step count: 5

Step Count is very important for an Animated Texture. My understanding is this actually jumps the animation sequence in steps to each new image location instead of continuously scrolling. It uses the map u-scale and map v-scale shader information. So in the 32x128 (4 textures), the 0.25 is 1 of those steps. The reason it's set at 5 (for this 4 image sequence) is if the image was infinite (starting over and over) 1-4 is the image with the 5th step meaning it starts over again.

Save this in animatedtextures as myanitex.scenery.

Misc. Information
The period seconds under FUNCTIONS can be set at any number you want depending on how fast you want it to animate. The numbers I use in this tutorial are just an average I started using for my animated textures and can be adjusted to your needs. After tooling the model I did rename it from animatedtextures.gbxmodel to myanitex.gbxmodel.
and samplefiles.

Gamerkd16
April 25th, 2008, 12:28 AM
This thread? (http://gbxforums.gearboxsoftware.com/showthread.php?t=59556&page=3&highlight=animate)

English Mobster
August 26th, 2009, 02:04 AM
Oi.
A bit of a bump, but I'm having a bit of the same problem, and search was my friend.

However, search did not tell me how to fix I bug I was having following the GBX tuts.
The RAR file had 404'd a LONG time ago, so that's no help.
I have a 32-frame tif file, at 256x16384. Yes, every frame is needed, and yes, it goes into Tool just fine.
I've followed the steps to the letter in the tutorial OmegaDragon linked to, but I'm encountering an issue.
In my Blood Gulch test map (and Sapien), instead of seeing my animated bitmap, instead, I see a white bitmap covering my animated shader. If I move around, it changes opacity, meaning it's still transparent, even though I did every little thing the tutorial told me to do.
I don't get it. That RAR would have been helpful if it hadn't 404'd, as I could have just modified a couple things and gotten it ingame without a hassle.
If it helps, Sapien spits out this beautiful error when I import the .scenery tag with my shader on it:
\halopc\haloce\source\rasterizer\dx9\rasterizer_dx 9_hardware_bitmaps.c(148): D3DERR_INVALIDCALL in IDirect3DDevice9_CreateTexture(global_d3d_device, width, height, bitmap->mipmap_count+1-mip_levels_to_drop, 0, rasterizer_bitmap_format_table[bitmap->format], D3DPOOL_MANAGED, &(IDirect3DTexture9*)bitmap->hardware_format, NULL) (code=-2005530516, error=<can't get description>)

Doing a Google search turns up one result (http://forum.halomaps.org/index.cfm?page=topic&topicID=15793), in which Dennis basically told the guy his laptop was too shitty to see it. However, I'm not getting that multi-colored shit like that guy was getting, I'm just getting a blank screen with some opacity to it that shouldn't be there.

Anyone have a fix or that RAR file?
Also, Ghost, if you're listening, you need to stick that animated shader tutorial on your tutorial database, I looked there first and couldn't find anything on it.

klange
August 26th, 2009, 07:21 AM
This is for a sign, right? You can always try the scripted device-machine + counter method.

English Mobster
August 26th, 2009, 06:45 PM
Scripted device-machine + counter method?

klange
August 26th, 2009, 09:18 PM
Scripted device-machine + counter method?
Basically, you slap a counter texture (like what the AR uses for its display) on a device machine and link it to the power value, then increment it by 1/frames every so often. While it's not as clean and efficient as the other method, it's far easier to implement.
This was my first test, the final version that I did in this map is much better looking (higher frame rate, etc.):
UACXEJiCOYc

English Mobster
August 27th, 2009, 12:26 AM
Ah, I get what you're saying.

So you just put all your frames onto a blue background, AR-style, then just tell Halo it's a counter, and tell the device_machine to go up by 1 every 1 second?

klange
August 27th, 2009, 01:27 AM
Ah, I get what you're saying.

So you just put all your frames onto a blue background, AR-style, then just tell Halo it's a counter, and tell the device_machine to go up by 1 every 1 second?
Pretty much. I'll grab the tag and script sources tomorrow afternoon, I have to extract them from my own map.

English Mobster
August 27th, 2009, 06:57 PM
That would be fucking awesome. Thanks.

klange
August 27th, 2009, 07:40 PM
HEK+ isn't running for me under Wine. I'll just jump into Win7, so tomorrow, not today. Sorry about that. I should get that working this weekend so this situation doesn't come up again. (Don't worry, it's not like I actually need to do anything here, just extract tags...)

In the meantime, here is the important part of the script:

(script continuous anim
(if (= (device_get_power sign) 1)
(device_set_power sign 0)
)
(device_set_power sign (+ (device_get_power sign) 0.0089285714285714285714285714285714) )
(sleep 2)
)I'm not sure if Halo uses that many decimal points, but regardless, you replace that with your 1/frames (this should be, what, 1/32 or something?). Adjust that and the sleep time to suit. This should be the higher framerate sign from the newest NFA (which was this gif animation, all frames, should play at around the same rate):
http://i241.photobucket.com/albums/ff304/ninjaturtleicecream/servedbythecheif.gif
Also, turning a really long gif animation into a sign takes some time to get it all right and make sure you don't have the spacer-blue in the actual image! I accidentally left a logo in that blue, and it appeared transparent during the animation :gonk: .