Jump to content


Photo

what video formats can be used in a "videomap"?


14 replies to this topic

#1 The Wheezing Geyser

The Wheezing Geyser

    Member

  • Member
  • PipPip
  • 34 posts

Posted 23 July 2017 - 01:24 AM

Reading id.sdk Tables & Materials for info on making material shaders I'm mostly stumped on the syntax, but can always cut/paste from existing examples and change the values around and hope for the best.

In Stage Keywords is an item

 

videomap [loop] <file>    "This stage uses a video stream as an image map".  

 

This seems like an easier plan than to make an animation out of a dozen or more diffusemaps.  Does anyone know what video format is required, and can someone point me to an example?

 



#2 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 658 posts

Posted 23 July 2017 - 02:42 AM

As of now, the engine uses old RoQ format https://modwiki.xnet...Q_(file_format)

 

There are plans for including .mp4 in the future. The question is, what do you plan to use it for? Both video files and gif-like animations for textures are extremely inefficient when it comes to large surfaces and tiling textures. In shaders, it's better to fake animation with instructions like panning, zooming or waving/distorting.



#3 The Wheezing Geyser

The Wheezing Geyser

    Member

  • Member
  • PipPip
  • 34 posts

Posted 23 July 2017 - 04:24 AM

Thanks for the info on the format.

As for what I'm going to do with the information, I won't know until and unless I try it, and knowing the format helps.  I didn't have in mind tiling such a thing over large surfaces in some attempt to bust the engine.



#4 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 557 posts

Posted 23 July 2017 - 12:25 PM

video map is a very nice way to have texture animations on a mission, what i like about it is that you can apply alpha to a RoQ video and it will work has any other texture, can be used to do caustics effects for example.

 

About examples here are some:

textures/particles/testvideo
{
	qer_editorimage	textures/editor/video.tga
	translucent
	noShadows
	{
		blend add
		videoMap	video/fireball.roq
		vertexColor
	}
}

video/tvshow
{
	qer_editorimage	textures/editor/video.tga
	{
		videoMap	loop video/test_1024.roq 
	}
} 

using the engine console you can convert multiple images into a roq video but afaik has limited resolution, to do higher rez roq's you can use the roq maker in this tools http://www.moddb.com...rdose-tools-set


Edited by HMart, 31 July 2017 - 11:18 AM.


#5 The Wheezing Geyser

The Wheezing Geyser

    Member

  • Member
  • PipPip
  • 34 posts

Posted 23 July 2017 - 04:30 PM

Excellent HMart!  Thank you.



#6 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 557 posts

Posted 23 July 2017 - 06:49 PM

No problem. :)



#7 NeonsStyle

NeonsStyle

    Advanced Member

  • Member
  • PipPipPip
  • 1257 posts

Posted 24 July 2017 - 04:09 AM

We need to talk about changing the video format to a more modern one. .ROQ is ancient and looks terrible. It's time

we added a modern format, like mp4 or something.  The main reason, is most affordable video editors don't support

it. 

 

If we had a modern video format, we could do so much more with briefing videos and maybe even cutscenes mid level.


Edited by NeonsStyle, 24 July 2017 - 04:10 AM.

I have a small YouTube channel making videos on a variety of games. Come and have look here:
 
https://www.youtube.com/c/NeonsStyleHD

 

Briarwood Manor - available here or in game

http://forums.thedar...2017-update-16/

 

 

 


#8 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8128 posts

Posted 24 July 2017 - 08:14 AM

We need to talk about changing the video format to a more modern one. .ROQ is ancient and looks terrible. It's time
we added a modern format, like mp4 or something.  The main reason, is most affordable video editors don't support
it. 
 
If we had a modern video format, we could do so much more with briefing videos and maybe even cutscenes mid level.


Targeted for v2.06

http://bugs.thedarkm...iew.php?id=4519
  • Anderson and NeonsStyle like this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#9 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 557 posts

Posted 30 July 2017 - 09:00 PM

We need to talk about changing the video format to a more modern one. .ROQ is ancient and looks terrible. It's time

we added a modern format, like mp4 or something.  The main reason, is most affordable video editors don't support

it. 

 

If we had a modern video format, we could do so much more with briefing videos and maybe even cutscenes mid level.

 

Nothing against implementing mp4, bik or any other modern format for full-screen videos but IMO you guys should still fully support roq, is a very lightweight format and really not very hard to do, you can indeed use modern video tools to make the frames for them, how, just export from your preferred video tool has multiple separate frames, all of them support that functionality and convert those frames to roq, with the engine console or with the tool i posted above and that's it.  

Other reasons why i think roq should not be deprecated, like i said is very lightweight, perfect for in level geometry integration (for example non interactive animated computer monitors), i mean it can be used in game as any other texture/material, roq supports all the idtech 4 OpenGL blending modes and alpha, enabling the ability of doing very nice effects, this without the need of, texture strips or separate texture frames ( like using various if stages and timers), for example like i said above, water caustics projecting on surfaces, or a special animated texture being projected from a spot light, for example cloud shadows moving over terrain, etc, no need for high rez videos for that. Effects for who mp4 or other modern format would be overkill imo.


Edited by HMart, 30 July 2017 - 09:02 PM.


#10 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 658 posts

Posted 31 July 2017 - 12:07 AM

All the examples you mentioned don't need movie files, all this stuff is made with scrolling textures and tricks in materials. Using video files for that is actually an overkill.



#11 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 557 posts

Posted 31 July 2017 - 11:02 AM

All the examples you mentioned don't need movie files, all this stuff is made with scrolling textures and tricks in materials. Using video files for that is actually an overkill.

 
Oh I know that but roq is a very lightweight video format and making a animation using scrolling textures, sometimes requires a very complicated material setup (if not using a texture strip) where's with a roq is simpler:
 
complex example:
 

textures/anim_caustics
{
qer_editorimage textures\sfx\caustics_ed.jpg
noShadows
nonsolid
translucent
 
   {
      if ( ( time * 24 ) % 23 == 0 )
      blend    add
      map textures\sfx\CausticsRender_001.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 1 )
      blend    add
      map  textures\sfx\CausticsRender_002.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 2 )
      blend    add
      map  textures\sfx\CausticsRender_003.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 3 )
      blend    add
      map  textures\sfx\CausticsRender_004.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 4 )
      blend    add
      map  textures\sfx\CausticsRender_005.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 5 )
      blend    add
      map  textures\sfx\CausticsRender_006.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 6 )
      blend    add
      map  textures\sfx\CausticsRender_007.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 7 )
      blend    add
      map  textures\sfx\CausticsRender_008.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 8 )
      blend    add
      map  textures\sfx\CausticsRender_009.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 9 )
      blend    add
      map  textures\sfx\CausticsRender_010.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 10 )
      blend    add
      map  textures\sfx\CausticsRender_011.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 11 )
      blend    add
      map  textures\sfx\CausticsRender_012.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 12 )
      blend    add
      map  textures\sfx\CausticsRender_013.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 13 )
      blend    add
      map  textures\sfx\CausticsRender_014.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 14 )
      blend    add
      map  textures\sfx\CausticsRender_015.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 15 )
      blend    add
      map  textures\sfx\CausticsRender_016.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 16 )
      blend    add
      map  textures\sfx\CausticsRender_017.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 17 )
      blend    add
      map  textures\sfx\CausticsRender_018.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 18 )
      blend    add
      map  textures\sfx\CausticsRender_019.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 19 )
      blend    add
      map  textures\sfx\CausticsRender_020.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 20 )
      blend    add
      map  textures\sfx\CausticsRender_021.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 21 )
      blend    add
      map  textures\sfx\CausticsRender_022.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 22 )
      blend    add
      map  textures\sfx\CausticsRender_023.tga
 
   }
   {
      if ( ( time * 24 ) % 23 == 23 )
      blend    add
      map  textures\sfx\CausticsRender_023.tga
 
   }
}

 
Better example using a texture strip:
 

textures/particles/caustics
{
   qer_editorimage textures/particles/causticsstrip_ed.jpg
   translucent
   {
      blend add
      map textures/particles/caustics.tga
      scale 1 / 24 , 1
      scroll table32[ time * .2 ] , 0
      rgb 0.1
   }
}

 
video map version:
 

textures/particles/caustics
{
   qer_editorimage textures/particles/causticsstrip_ed.jpg
    translucent
    {
        blend add
        videoMap   loop video/caustics.roq
    }
}


Quality is a problem tho using a 512x512 roq vs a 1024x1024 or larger texture strip does make a diference, but the tool i posted above solves that problem has it makes larger rez roq's.

 

About performance i didn't tested side by side a roq video vs a texture strip, so i can't really say for sure what's faster or slower, i only know idSoftware used plenty of 512x512 roq videos in Doom 3, but imo is a matter of preference, if you don't want to use a video for a texture animation, you are not forced to and by not using roq, you also gain the ability to better tweak the animation at run time.


Edited by HMart, 31 July 2017 - 11:46 AM.


#12 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 658 posts

Posted 31 July 2017 - 02:31 PM

I was thinking exactly about this. With 1k or 2k textures it's not much of use. That first example is a huge overkill, to put it mildly, you're basically multiplying the number of tris on a model by 23 (!), not to mention additional drawcalls. That said, using video for this seems like an unintuitive idea as well (and not exactly cheap, performance-wise). Usually 2-3 scrolling tileable textures is a way to go:

 


Edited by Judith, 31 July 2017 - 02:35 PM.


#13 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 557 posts

Posted 31 July 2017 - 06:31 PM

I was thinking exactly about this. With 1k or 2k textures it's not much of use...


Personally i would not use .roq with 2k textures as well (i don't even think roq can go that far), at lest for ingame affects but for small ingame screens and some effects i don't think 512x512 roq's are that bad, but is personal opinion.
 

...That first example is a huge overkill, to put it mildly, you're basically multiplying the number of tris on a model by 23 (!), not to mention additional drawcalls...


Yes is overkill, that is why i also don't recommend it to anyone, my recommendation is to use a texture strip or a roq if you need so much frames.

Can you explain why changing stages on a single material causes you to multiply the tris on a model? Is the first time i'm hearing that.
 

...That said, using video for this seems like an unintuitive idea as well...


Ok but I don't agree, apart from the inability to tweak it after the fact (change frame speed for example) imo is a very fast and easy way to have texture animations on levels. But like i said before, anyone is free to use whatever they like, the final outcome is what matters.
 

(and not exactly cheap, performance-wise).


How much impact in performance are you saying this have? 

I know roq is a very old but very cpu efficient video format, personally I have not tested it, at lest not on a performance basis, i did tested it visually, for example, the .roq based caustics against the texture strip ones and apart from roq looking more blurry, personally i didn't saw any performance impact of note between the two, but the roq was 512x512, i don't know how would it behave with a much larger roq, i'm sure the larger the .roq the bigger the performance impact.
 

...Usually 2-3 scrolling tileable textures is a way to go:


That is true, if your texture animation works well with so few frames, with no noticeable ick-ups or repetitions but if you are trying to simulate, for example, rain drops streaming down windows, or a TV show (like those of Max Payne for example) or even a video communication on a screen, like those of Doom 3, etc, you certainly need more than 2 or 3 frames, in the caustics case i posted, it has 24 frames, and you are right is indeed overkill, i'm certain it can work with less, is just a test i did and the source data was made of 24 frames.

 

Btw that UE4 tutorial is very nice thanks for posting it, but i most say his caustics do not behave exactly like mine, at lest not on flat surfaces, like flat floors and walls, on mine the caustics undulate and change shape but his is a very efficient trick indeed and i would recommend it over mine. 


Edited by HMart, 31 July 2017 - 06:53 PM.

  • Judith likes this

#14 stgatilov

stgatilov

    Member

  • Development Role
  • PipPip
  • 467 posts

Posted 31 July 2017 - 09:24 PM

When ROQ video is played, the whole texture is sent from CPU to GPU each frame.

This is OK for FMV, but if you start putting it all over the level, performance would suffer, I guess.

I don't know how easy it is to share the same video across several objects/materials, and how easy it is to avoid video decoding/uploading if the player does not see the material from his area...


  • Judith likes this

#15 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 658 posts

Posted 01 August 2017 - 02:02 AM

 

How much impact in performance are you saying this have?

 

What Stgatilov said about ROQ. As for materials, I didn’t test it super-thoroughly, but did some tests in my WIP map thread, as I was curious why my 500-tris model shows us as a 3500 tris in a caulked room.

Apparently both ambient light and fog light add the initial number of tris to the model, as every additional light touching the model will do. Same applies to material complexity. When you have a simple material with diffuse, specular, and normal shortcuts, they don’t have any additional cost. But every stage defined within {} brackets adds the base number of tris to the model (and some drawcalls too). While idtech4 seems to be pretty generous in terms of number of tris per scene (we’re talking millions of triangles, literally), I’d rather be on the safe side and have that overhead for AI, animations, transparency, things like that. You never know when you might need it :)


  • HMart likes this



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users