Announcement

Collapse
No announcement yet.

So how can i make animated textures in a model?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • So how can i make animated textures in a model?

    I was going to finish this doom like barrel



    But then realized that the Doom barrel had some animations in the sprite.
    What am i suppose to do?
    I am like a stray dog, lost in between what I do and what I should do.
    But sometimes, all you need is Imagination.


  • #2
    iirc, name the textures barrel_0, barrel_1, barrel_2 etc.
    Gnounc's Project Graveyard Gnounc's git repo

    Comment


    • #3
      I think that only works if the actual sprite has multiple frames. Though, I really dont know
      www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

      Comment


      • #4
        The bubbling/boiling toxic slime animation?

        Assuming you mean to use the model, and not a render of it, here are some possible options (IIRC):

        1. Give it a second skin. Animate skin with QC?

        2. Add more frames, and move the vertices around on top?

        3. Make green bubble sprites, and set the bubble generator (like air_bubbles) on top of the barrel in the map?

        The exploding boxes in Quake are BSP models, not meshes, so that's another story.

        Comment


        • #5
          1. Give it a second skin. Animate skin with QC?
          If it's a model, that's what I would try. Make a think function for the barrel entity that changes the skin. Let's say your barrel has three skins: a default base skin and two more after it. So every time the think function is called on, do something like:

          if (self.skin == 2)
          self.skin = 0;
          else
          self.skin = self.skin + 1;

          The default skin is self.skin = 0. 1 and 2 would be subsequent skins. You could call this think function Barrel_think() or something like that. In the spawn function for the barrel, you could define think as:

          barrel.think = Barrel_think;
          barrel.nextthink = time + 0.1;

          (This is assuming your barrel entity is defined as "barrel"). Then the think function is called every 1/10th of a second, and therefore the skin is changed every 1/10th of a second. You could of course add several more skins and change the nextthink time to give it a smoother animation. I don't know how many skins you can have in a single MDL file. Probably a lot. I've used up to six before.

          Here's a link to info on MDL models. MDL file format specifications (Quake's models)

          Just an idea. I'm sure it would work. You would have to play with it though.
          'Replacement Player Models' Project

          Comment


          • #6
            Couldn't i just add the Model to a custom ent file?
            I am like a stray dog, lost in between what I do and what I should do.
            But sometimes, all you need is Imagination.

            Comment


            • #7
              No matter what you do, the model must be defined and spawned within QC. There is no way around that unless you run a mod that allows adding custom models (SMC, Quoth, etc.). Even if you do this, it does not solve your texture animation problem. You need to do this through QC if your model is not a sprite or a BSP, and as far as realism goes, sprites and BSPs suck for models.

              Adding the model to an ent file has to happen no matter what. But your editor won't load the model upon compilation if you don't code it in using QC. It is very simple QC to define a static model spawn function, and the skin info i suggested should work. When you add an entity to an ent file, you are calling on the entity's spawn function, which has to be coded.
              'Replacement Player Models' Project

              Comment


              • #8
                there's already a misc_explobox entity (or two) that can be used, with this model as a direct drop-in replacement.
                with an mdl, you have the option of a skingroup. this is a set of skin frames that automatically animate at some rate (the format itself supports arbitrary intervals between frames, but gl engines tend to assume a single interval, and editors will probably hardcode it as 0.1 or something anyway).

                md2 and later model formats don't support this feature. including iqm/dpm/md3.

                if you're able to use shaders, you can use a line like: 'animmap 10 frame1.tga frame2.tga frame3.tga' in the place of a 'map' line, which should work for any model format, but it'll make any internal textures (mdl) redundant.
                Some Game Thing

                Comment


                • #9
                  That's very cool, Spike. I wondered if there was something like that, but doubted it, since I don't think it's ever used in vanilla Quake?

                  Anyhow, how does one replace the bsp with an mdl, when misq.qc references b_explob.bsp explicitly? Just change the .mdl extension to .bsp, and let quake figure it out?

                  Btw, I don't know if anyone uses QME anymore, but I see that it does let you "Edit the duration of skins" when there's more than one in the skingroup.

                  Comment


                  • #10
                    Originally posted by gulliver-trans View Post
                    That's very cool, Spike. I wondered if there was something like that, but doubted it, since I don't think it's ever used in vanilla Quake?

                    Anyhow, how does one replace the bsp with an mdl, when misq.qc references b_explob.bsp explicitly? Just change the .mdl extension to .bsp, and let quake figure it out?

                    Btw, I don't know if anyone uses QME anymore, but I see that it does let you "Edit the duration of skins" when there's more than one in the skingroup.
                    Hello gulliver-trans,

                    You need an engine with replacement content support, like FTE and several others.
                    All the well known replacement files for ammo crates, health crates and also exploding boxes are .mdl or .md3 format models. For example the ones from Ruohis and others.

                    Spike explained me once how the magic works:
                    The real format is hidden in the first characters inside the model.
                    Open it with a text editor for example and you will find: IDP0 = .mdl IDP3 = .md3
                    When you rename it to .bsp, like vanilla QC called it (just as you mentioned it), the engine sees its real format and can handle it this way.

                    The set from Ruohis for example:



                    Shader driven .bsp models can be found here.
                    The animMap shader is exactly what I used for them.

                    Best regards,
                    Seven
                    Last edited by Seven; 04-25-2014, 02:17 PM.

                    Comment


                    • #11
                      Originally posted by Seven View Post
                      Hello gulliver-trans,
                      You need an engine with replacement content support, like FTE and several others.
                      Seven
                      Darkplaces works right?
                      I am like a stray dog, lost in between what I do and what I should do.
                      But sometimes, all you need is Imagination.

                      Comment


                      • #12
                        Figured it out, put the Model aka the BSP in the wrong file path.
                        I am like a stray dog, lost in between what I do and what I should do.
                        But sometimes, all you need is Imagination.

                        Comment


                        • #13
                          Thanks, Seven. You're right -- the file header is what matters.

                          In fact, I just renamed a random .mdl to b_explob.bsp and it worked fine, even in default GLQuake, though it was cycling the frames of that model. I didn't test skingroups, though.

                          Interesting stuff:
                          MDL file format specifications (Quake's models)

                          Comment


                          • #14



                            So the model works (looks ugly).

                            But there is no animated top.
                            I am like a stray dog, lost in between what I do and what I should do.
                            But sometimes, all you need is Imagination.

                            Comment


                            • #15
                              Originally posted by Shambler234 View Post
                              So the model works (looks ugly).

                              But there is no animated top.
                              Hello Shambler234,

                              The original .bsp files in the .pak "maps" folder are *really* .bsp models.
                              So, you could also open them with texmex (for example) to see the texture names, that was used for them.

                              Lets talk about the 'b_explob.bsp' model, as this is your target.
                              There are at least 3 possibilities to replace the original model (using DP):

                              1.) You could create your own custom .bsp model, use the same texture names for it and put the replacement .bsp model into your maps folder. DarkPlaces searches for the .bsp replacement textures inside: "textures" subfolder. So, also your replacement textures:
                              +0_box_side.tga and +0_box_top.tga
                              +1_box_side.tga and +1_box_top.tga
                              have to go in that subfolder.
                              It will be animated.

                              2.) You could create your own .mdl replacement model, rename it to 'b_explob.bsp' and put it into your "maps" folder. You can also create external texture for it, call it 'b_explob.bsp_0.tga' and put it in your "maps" folder as well.
                              It will not be animated.

                              3.) You could create your own .md2 or .md3 replacement model, rename it to 'b_explob.bsp' and put it into your "maps" folder. These models have their texture path included, so you have to put your texture for it into that path.
                              It will not be animated.


                              To animate points 2.) and 3.) you must use a shader with the animMap keyword, like here.
                              Your biggest advantage is, that you can now animate completely to your imagination.
                              That means, you are not bound to 2 *texture-frames*. You can use a lot more. You can also have different time gaps between different *texture-frames*.
                              It seems, that this is what you was aiming for ?


                              You do not need a qc-edit for all of the above points.
                              With a qc-edit you are of course completely free and can do with that exploding box whatever you want...

                              Be aware that .bsp models are positioned on one of their corners, while .mdx models usualy are created with their origin in center. You might want to consider this.

                              Best of luck,
                              Seven

                              Comment

                              Working...
                              X