Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Linguica

Cornell Box

Recommended Posts



http://www.doomworld.com/linguica/hax/crnllbox.zip

Spoiler

===========================================================================
Primary purpose         : Single play
===========================================================================
Title                   : Cornell Box
Filename                : crnllbox.wad
Release date            : December 31 2016
Author                  : Linguica
Email Address           : linguica@doomworld.com
Other Files By Author   : instadm.wad, selfie.wad, googol.wad, do-it.wad
Misc. Author Info       : Doomworld person

Description             : NOTE: this WAD is best played in a port with a
                          floating-point renderer. As far as I know the only
                          ports that have done this are Eternity and 3DGE. It
                          will still play in basically any other port but you
                          will get unwanted seams / sparklies to various
                          degrees.
                          
                          The Cornell Box is one of the most well-known
                          scenes in 3D rendering. It was originally designed
                          as a test for realistic lighting models in the
                          early days of 3D rendering, with a physical model
                          being built and exhaustively measured in order to
                          provide a baseline for comparisons. In more recent
                          years, it mostly used as a simplistic "proof of
                          concept" 3D scene for 3D renderers. The geometry of
                          the Cornell Box makes it perfect for recreation in
                          the vanilla Doom engine, so I did it.
                          
                          Besides being a reasonably accurate recreation of a
                          standard Cornell Box, this WAD is also, to my
                          knowledge, the first example of a "megatextured"
                          vanilla Doom WAD. Megatextures came to prominence
                          in idTech 5, as seen in RAGE, and are also used in
                          idTech 6 and Doom 2016. To oversimplify things,
                          they allow a level designer to use unique textures
                          for every surface. Except for (obviously) the black
                          area outside the cube, every surface in this WAD
                          has a unique texture.
                          
                          Furthermore, this level just so happens to top out
                          at precisely 128 visplanes if you're standing in
                          the right spot, which I think is kind of a neat
                          trick.

Additional Credits to   : wartorn for the UV unwraps I needed.
                          esselfortium for the suggestion to use smaller padded
                          flats to reduce seams in vanilla.
                          https://community.renderman.pixar.com/article/400/cornell-box.html
                          for the sample render and the files. 
===========================================================================
* What is included *

New levels              : 1
Sounds                  : No
Music                   : No
Graphics                : Yes
Dehacked/BEX Patch      : No
Demos                   : No
Other                   : No
Other files required    : None


* Play Information *

Game                    : Doom 2
Map #                   : Map01
Single Player           : Designed for
Cooperative 2-4 Player  : Player starts only
Deathmatch 2-4 Player   : Player starts only
Other game styles       : None
Difficulty Settings     : Not implemented


* Construction *

Base                    : New from scratch, but also totally not new
Build Time              : 14 hours (mostly on earlier attempts that had to be
                          scrapped)
Editor(s) used          : GZDB, SLADE, PSP 6, a PHP script I wrote
Known Bugs              : Most renderers introduce graphical glitches due to
                          rounding errors.
Tested With             : doom2.exe, others


* Copyright / Permissions *

This work is licensed under the Creative Commons Attribution 4.0
International License. To view a copy of this license, visit
http://creativecommons.org/licenses/by/4.0/

You are free to copy and redistribute the material in any medium or format;
and remix, transform, and build upon the material for any purpose, even
commercially. If you do so, you must give appropriate credit, provide a link
to the license, and indicate if changes were made. You may do so in any
reasonable manner, but not in any way that suggests the licensor endorses you
or your use.

* Where to get the file that this text file describes *

The Usual: ftp://archives.gamers.org/pub/idgames/ and mirrors

Share this post


Link to post

I'd like to give a special thanks to esselfortium for making me throw out an earlier version of the WAD that was literally 100% finished because she pointed out that if I made the sectors smaller than 64x64 and made the flats all have "borders" that it would help eliminate the sparklies in engines using the normal Doom rendering code.

I ended up using sectors of 48x48, which meant the whole map had to be shrunk down to 75% and all the textures and flats redone (the flats were further complicated by having to manually misalign them within the texture itself, and I ended up having to write a script to do it for me). I also find it interesting that the flats are effectively square textures with an 8-pixel wide safety border to prevent seams with their neighbors, which is precisely the same thing that happens with megatextures in Doom 2016.

Also the WAD was originally a cube of 8x8 and not 7x7, but I forgot to realize that even just a bare cube of 8x8 unique floor and ceiling textures would already add up to 128 visplanes, before even adding in the boxes or an "outside" area, and since vanilla compatibility was sort of the whole point, that was the first instance of having to start over from scratch.

Share this post


Link to post

That's a really inventive way to avoid the 'sparklies'. I'm waiting to see some insane Doomer use this technique to give us the best vanilla-compat static lighting we've ever seen in a map!

Share this post


Link to post

This is amazing. FYI I think Ed used megatextures in Putrefier (edit: which wasn't vanilla, of course).

Share this post


Link to post

This is sweet Ling; great job with this! Stuff like this, and the Linguortals, and the collision code stuff you've done makes my day when I wake up to something so interesting.

Share this post


Link to post
Kapanyo said:

Thrilling stuff! The question is: could it be put to use in a level?

It *is* put to use in a level though??

If you mean a "real" level, then: sure, if you were willing to go to the time and effort. That's kind of the point of a proof of concept like this.

Share this post


Link to post

I'm not sure what I'm seeing... could someone explain the significance of this? Forgive me for being uninformed but it just looks like a room with some special lighting and texture work.

Share this post


Link to post

It's basically modelling how light bounces around a scene, by 'baking' the lighting into the textures and flats, and is an interesting study in and of itself.

It isn't useful (in this particular form) for a Doom map since the sprites are not going to interact with the baked in lighting, and creating the flats would be a major pain in the ass.

But you could implement this differently to create a similar, more stylised effect. For example GZDoom's dynamic lights could be used to fake the coloured light, or a large number of sector gradients with a range of tinted texures.

Share this post


Link to post
Linguica said:

this WAD is also, to my knowledge, the first example of a "megatextured" vanilla Doom WAD.

Uhh, isn't the Icon of Sin on MAP30 a megatexture of some sort? The Unholy Trinity (from 1994) uses that approach as well.


But still, awesome job. I love your h4x0ring and this one didn't let me down!

Share this post


Link to post

How was the shadow effect on the floor done without it being on the ceiling as well?

Share this post


Link to post
Glaice said:

How was the shadow effect on the floor done without it being on the ceiling as well?

All of the lighting is baked into the textures and flats.

Share this post


Link to post

Now we have another design concept for the next community project. Get ready your favorite graphic tools and 3D renderer, everyone.

Still it's awesome to see it with vanilla compatibility and limited color palette.

Share this post


Link to post

Before I forget, I'll post the thing I used to make the flats. Because I ended up making the flats have a "safety border" or whatever, that means they don't look "right" when just viewing them, because they all need to be misaligned so that they will end up looking properly aligned in-game:



To do this, I ended up writing a script in (sigh) PHP. Here it is if for some reason you are compelled to do something similar, it's pretty simple and straightforward.

Spoiler

<?

$border = 8;
$sectorsize = 64 - (2*$border);
$im = @imagecreatefrompng("ceiling.png");
for($i=0; $i<7; $i++)
{
	for($j=0; $j<7; $j++)
	{
		$dest = @imagecreatetruecolor(64, 64);

		$startx = $i*$sectorsize - $border;
		$starty = $j*$sectorsize - $border;

		$i_offset = -1 * (($border*$i*2)%64);
		$j_offset = -1 * (($border*$j*2)%64);

		imagecopy($dest, $im, $i_offset + 64, $j_offset + 64, $startx, $starty, 64, 64);
		imagecopy($dest, $im, $i_offset,      $j_offset + 64, $startx, $starty, 64, 64);
		imagecopy($dest, $im, $i_offset + 64, $j_offset,      $startx, $starty, 64, 64);
		imagecopy($dest, $im, $i_offset,      $j_offset,      $startx, $starty, 64, 64);

		$filename = "c_0" . ($j+1) . "_0" . ($i+1) . ".png";

		imagepng($dest, $filename);

		imagedestroy($dest);
	}
}
imagedestroy($im);

?>

Share this post


Link to post

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
×