• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
  • entries
    37
  • comments
    37
  • views
    36814

Possible: BTIC1E (BPTC / BC6H / BC7 + Video Codec)

Sign in to follow this  
Followers 0
cr88192

1292 views

yes, yet more codec wackiness...


seeing as how my graphics hardware has a limited number of options for (non DXTn / S3TC) compressed texture formats, but does support BPTC / BC6H / BC7, which hinder effective real-time encoding (*), it may make sense to consider developing a video codec specifically for this.

*: though there is always the option of "just pick a block type and run with it", like always encoding BC7 in mode 5 or BC6H in mode 11 or something.
note: BPTC here will be used (in the OpenGL sense) to refer both to BC6H and BC7.
structurally, they are different formats, and need to be distinguished in-use.
when relevant, BC6H and BC7 (their DirectX names) will be used (mostly because names like "RGBA_BPTC_UNORM" kind of suck...).

basic design:
essentially fairly similar to BTIC1C and BTIC1D (which in turn both derive from Apple Video / RPZA).

http://cr88192.dyndns.org:8080/wiki/index.php/BTIC1E

unlike 1C and 1D, it (mostly) sidesteps a lot of the complexities of these texture formats, and essentially treats the blocks mostly as raw data. this should still allow a moderately simple and fast decoder (into BPTC or similar).
also this stage of the process will be lossless.

this encoding allows a fairly arbitrary split between block-header and block data, which an encoder should be able to try to optimize for (and search for the "greatest savings" in terms of where to split up the block at). this also includes the ability to do "simple RLE runs" for repeating block-patterns, as well as to store raw/unencoded runs of blocks.

note that it isn't really viable to cleanly split between the header and index portions of a block given the way the blocks work.

Enocde Process:
RGB(A) Source Image -> Pixel Block Quantizer + BPTC Encoder -> BTIC1E Frame Encoder -> Deflate -> Packaging/Container.

Decode Process:
Container/Packaging -> Inflate -> BTIC1E Decoder -> BPTC (passed to GL or similar).

the "Pixel Block Quantizer" step will basically try to fudge blocks to reduce the encoded image size; it is unclear exactly how it will tie in with the BPTC encoders. as-is, it is looking mostly like a tradeoff between an RGBA-space quantizer ("pre-cooking" the image) and a naive "slice and dice" quantizer (hack bits between blocks coming out of the BPTC encoder and see what it can get away with within the error threshold, basically by decoding the blocks to RGBA and comparing the results).


an issue: I have rather mixed feelings about BPTC.
namely, it is only available in newer desktop-class GPUs, and could be rendered less relevant if ETC2 becomes widespread in upcoming GPUs (both having been promoted to core in OpenGL).

some of this could potentially lead to cases of needing multiple redundant animated-texture videos, which would be kind of lame (and would waste disk space and similar), though potentially still better than wasting video memory by always using an RGBA16F or RGB9_E5 version.


could almost be a case of needing to implement it and determine whether or not it sucks...


ADD:
figured the likelihood of BTIC1E sucking was just too high.

started working on another design:
http://cr88192.dyndns.org:8080/wiki/index.php/BTIC3A

which would be intended as a format to hopefully target both DXT and a BPTC subset, with other goals of being faster for getting to DXTn than BTIC2C, and compressing better than BTIC1C, target speed = 300 Mpix/sec for a single threaded decoder.

going and checking, the gap isn't quite as drastic as I had thought (if I can reduce the bitrate to 1/2 or 1/3 that of 1C, I will be doing pretty good, nevermind image quality for the moment).

I guess the reason many videos can fit 30 minutes in 200MB is mostly because of lower resolutions (640x360 has a lot fewer pixels than 1024x1024 or 2048x1024...).

1
Sign in to follow this  
Followers 0


4 Comments


I am a 'file format' kind of guy, and I get happy reading these posts about various storage and encoding methods.

 

Might be time to go to meetings... ;)

0

Share this comment


Link to comment

yeah, and in my case it is mostly trying to find a "good" solution to the general set of issues I keep running into.

 

like, wanting videos to go into textures while getting good performance and not producing overly huge files (vs "real" codecs), ...

 

 

luckily, most of these codecs are fairly simple and consist largely of reused code, mostly with tweaks being made to the format structure encoding details in an attempt to adjust for things like compressor efficiency and performance.

 

the result then is a small "forest" of various experimental codecs.

 

 

my newer BTIC3A codec could at least potentially/hopefully address a few issues (should compress a lot better than 1C at least).

 

I am less certain about the decoding performance, since trying to implement it, there are areas where it is both simpler and more complex than 1C in terms of per-block overhead.

 

but, as long as it goes faster than a typical DCT codec, it is probably good, and I suspect it probably will.

 

wont really know until it is fully implemented though...

1

Share this comment


Link to comment

It may have been said before; but I didn't catch it; what is the eventual goal of having actual video being displayed on a texture?

When I dealt with this stuff years ago, it was just to render cutscenes full screen; but it seems like you might have different ends?

0

Share this comment


Link to comment

mostly it would be for sake of:

better animated textures, which already work acceptably (already used for things like lava/slime/water/fire).

 

basically, more traditional animated textures have fairly severe size and/or length limit issues, limiting them mostly to often low-res and either very short or having a very low framerate (if a person tries to stretch 10 or 16 frames over multiple seconds).

 

also in-game TVs and displays.

for example, you could have an in-game TV which could be triggered to play a video-sequence on some event.

 

...

 

a lot of this is done in various places in Doom 3, which uses RoQ (another VQ-based format), however, Doom 3 generally uses fairly low resolutions, and still has fairly large file sizes.

 

cutscenes are also possible, but as-is, conventional cutscenes could be better served by a more conventional video format (since you can get by using a lot more of the CPU time for a cutscene).

 

so, it is basically trying to do things like get multiple video streams to decode at the same time using relatively low CPU load.

 

elsewhere I did a test:

http://www.youtube.com/watch?v=ktYmJ6NFamQ

videos are 512x512 (and 30Hz), but I did subsequent tests with 1024x1024 videos, and framerates still held up. (note: the video decoding is happening inside the render thread in this case...).

 

but, then noted a problem: ~ 10 minutes of video at 1024x1024 works out to around 450MB with the codec (1C) even with fairly poor video quality.

so, this gave me reason to look at maybe trying to address the bitrate issue.

10 minutes of video at 200MB at better quality would be a little more passable.

 

 

note: BTIC1C is essentially a Deflate-compressed variant of the Apple Video / RPZA format (historically RPZA was used by applications based on Apple QuickTime). the Deflate generally reduces bitrate by about 40% with a "modest" performance impact. (I made other extensions to the format though, such as for an alpha channel and mipmaps).

 

 

so, more fiddling, and designing (and implementing) a more aggressively compressed, but hopefully still fast to decode, format.

0

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now