Video

It is possible to include a small video within a map by using a .roq format in combination with a videomap stage shader.


Prerequisites

Shaders with a videomap stage enable you to have a video playing in your map, eg. on a tv screen. To get this to work you need the following things:

  • A video in .roq format running at 30 fps. from my experientation it must have width/height of a power of 2 , but the only size that worked for me was 256*256.
  • A shader with a videomap stage. for example this one gives a semi transparent video stage with an overlay on top to block the Fraps text.

.roq video file

To get the video into roq format follow these steps (assuming your source file is in avi format)
-use VirtualDub to resize it into 256*256 size at 30 fps (select a resize filter - then save)
-get SwitchBlade and drop your resized avi onto the DropROQ.exe, this will encode the video into .roq format and spit it out into the same directory as the source .avi.

Shader

textures/mapname/shadername
{
surfaceparm nolightmap
q3map_lightimage textures/text/ref_map.jpg
q3map_surfacelight 70
q3map_backsplash 15 30
{
videoMap video/videoname.roq
blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen const 0.85
tcGen base
}
{
map textures/mapname/overlay.tga
blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
tcGen Base
}
}

Tips

  • Cut the sound out of the source file to make the roq smaller.
  • You can use fraps to record video from an application on your computer, but unregistered versions of it leaves the "Fraps" text at the top of the video, you can cover this up with another stage however, as shown in the provided shader.
  • More than one video playing at once seems to cause a graphical glitch, and on low spec systems might cause low fps, but you could still have more than one screen playing the same video.
You can find an example roq that works here.

Courtesy of gareth, edited by Survivor


Page Information

  • 1 year ago [history]
  • View page source
  • You're not logged in
  • No tags yet learn more

Wiki Information

Recent PBwiki Blog Posts