Another rendering update

Anything concerning the ongoing creation of Futurecraft.
User avatar
fr0stbyte124
Developer
Posts:727
Joined:Fri Dec 07, 2012 3:39 am
Affiliation:Aye-Aye
Re: Another rendering update

Post by fr0stbyte124 » Mon Jan 07, 2013 6:08 am

Dr. Mackeroth wrote:
fr0stbyte124 wrote:I am happily employed and can buy all the insects I want, thankyouverymuch.

Starting out, I am trying to keep the new engine looking exactly like the old one, except for a few really cheap things like mipmapping and fxaa. We'll probably have dynamic shadowing before too long because baked lighting won't look good on a moving ship. After that, who knows. I'll take suggestions and give you all an idea of how much is left in the graphical budget to spend on the fancies.
Besides dynamic shadows, we could also do with dynamic lights (natural progression), so we can have search-beams or torches.
This can get seriously expensive depending on how it is done. Most of the time you see spotlights, the rest of the environment lights are cooked on.
Iv121 wrote:Most importantly I think we should have colored light ! (Screw movement :tongue: ). This can make all those screenshots I photoshoped a reality.
We get this for free, or at least an approximation. Every surface has a 16-bit color field, which is needed to store biome colors. By averaging the color of the regular texture and then making the texture part store the difference from that color, we can change the average color for every surface. There's probably even better color models for this. But it's all definitely doable.

Dr. Mackeroth
Designer
Designer
Posts:397
Joined:Fri Dec 07, 2012 11:59 pm
Affiliation:Alteran
Location:In the Holy Citadel of Altera

Re: Another rendering update

Post by Dr. Mackeroth » Tue Jan 08, 2013 3:45 am

fr0stbyte124 wrote:
Dr. Mackeroth wrote:
fr0stbyte124 wrote:I am happily employed and can buy all the insects I want, thankyouverymuch.

Starting out, I am trying to keep the new engine looking exactly like the old one, except for a few really cheap things like mipmapping and fxaa. We'll probably have dynamic shadowing before too long because baked lighting won't look good on a moving ship. After that, who knows. I'll take suggestions and give you all an idea of how much is left in the graphical budget to spend on the fancies.
Besides dynamic shadows, we could also do with dynamic lights (natural progression), so we can have search-beams or torches.
This can get seriously expensive depending on how it is done. Most of the time you see spotlights, the rest of the environment lights are cooked on.
Iv121 wrote:Most importantly I think we should have colored light ! (Screw movement :tongue: ). This can make all those screenshots I photoshoped a reality.
We get this for free, or at least an approximation. Every surface has a 16-bit color field, which is needed to store biome colors. By averaging the color of the regular texture and then making the texture part store the difference from that color, we can change the average color for every surface. There's probably even better color models for this. But it's all definitely doable.
"Cooked on"?
This is a signature.

Chairman_Tiel
Rear Admiral
Rear Admiral
Posts:1890
Joined:Sat Dec 01, 2012 9:39 am
Affiliation:GLORIOUS REPUBLIC

Re: Another rendering update

Post by Chairman_Tiel » Tue Jan 08, 2013 8:08 am

Correct me if I'm wrong, but I think that by cooked fr0st means not rendered, but there to begin with in the level's textures and shaders to lessen hardware strain. In this case he means (again, may be wrong) that when you put in expensive stuff like spotlights dynamic lighting for the rest of the game level is usually not possible, instead there are simply objects with a basic shader to look like they're casting light, when in fact the shadows are part of the textures to begin with.
[spoiler]Image[/spoiler]

User avatar
fr0stbyte124
Developer
Posts:727
Joined:Fri Dec 07, 2012 3:39 am
Affiliation:Aye-Aye

Re: Another rendering update

Post by fr0stbyte124 » Tue Jan 08, 2013 9:43 am

In this case, cooked on is what you normally see whenever you add or remove a torch to an area, or open a hole in a cave. Those light levels are built into the polygons. That kind of light costs virtually nothing to play back, but updating it requires updating the entire patch. It's more efficient to do that now than in vanilla minecraft, but I still wouldn't want to make a habit of it.

Chairman_Tiel
Rear Admiral
Rear Admiral
Posts:1890
Joined:Sat Dec 01, 2012 9:39 am
Affiliation:GLORIOUS REPUBLIC

Re: Another rendering update

Post by Chairman_Tiel » Tue Jan 08, 2013 9:48 am

Is there a difference between 'cooking' and 'baking' as far as rendering is concerned?
[spoiler]Image[/spoiler]

User avatar
fr0stbyte124
Developer
Posts:727
Joined:Fri Dec 07, 2012 3:39 am
Affiliation:Aye-Aye

Re: Another rendering update

Post by fr0stbyte124 » Tue Jan 08, 2013 9:51 am

No, I'm just really inconsistent with my terminology. "Baked on" is the correct industry term.

Dr. Mackeroth
Designer
Designer
Posts:397
Joined:Fri Dec 07, 2012 11:59 pm
Affiliation:Alteran
Location:In the Holy Citadel of Altera

Re: Another rendering update

Post by Dr. Mackeroth » Tue Jan 08, 2013 5:06 pm

fr0stbyte124 wrote:No, I'm just really inconsistent with my terminology. "Baked on" is the correct industry term.
Right. Thanks, that helps.. A bit.

How do they handle lighting in games where you can walk around with a lantern or torch?
This is a signature.

User avatar
fr0stbyte124
Developer
Posts:727
Joined:Fri Dec 07, 2012 3:39 am
Affiliation:Aye-Aye

Re: Another rendering update

Post by fr0stbyte124 » Tue Jan 08, 2013 6:57 pm

Typically, it's deferred lighting. That's where lighting is calculated independently for for each light source, and then all of them are summed up in a single pass in screen-space.

-For Spotlights, you have to make a shadow map with a conical projection matrix. However, once that is done, you have an idea of which pixels on the screen need to read in that particular map.
-Point-lights are the same, only they are typically mapped to a 6-sided texture called a cubemap, with which they can project onto all surfaces. This one dies off with distance.
-Sunlight is the same as spotlights, except that its projection matrix is orthogonal (rectangular rather than conical, since the sun's distance is essentially infinity). More work is usually put into this one, because the shadow map has to cover a much larger area.

Shadow maps themselves are simply depth maps stored to a texture. Once reprojected, you calculate whether the screen-space pixel is in front of or behind the light source's depth map to decide whether that surface is lit or not. Things can get a lot more sophisticated when you start taking into account texture resolutions, soft shadows, atmospheric scattering, and so on, but all of them are depth comparisons at their core.

Every time you add another light source, you have to redraw the scene another time and use more resources to store the results. However, you can often reuse the results from frame to frame, so long as the lightsource hasn't moved. Still a game developer will try to limit the number of dynamic lights present in any scene to avoid swamping the GPU. We won't have any control over the number of lights here, so it could easily get out of hand fast.

Minecraft simplifies the approach by storing the light level for each voxel with a simple rule of "light level = brightest neighbor's light level - 1". Technically, this is also deferred lighting, only this particular method would be prohibitively expensive to do in realtime on a GPU. The Minecraft approach can't do hard shadows, but when smoothed, does make for some rather nice soft lighting, which can even spill around corners. The only other way to make that effect in realtime is a technique called global illumination, which happens to be fantastically expensive and only the highest level GPUs can do it at all.
Most of the time you see global illumination, the devs are cheating and placing ambient lights, which ignore walls and surface angles completely, or it's baked into the texture.

----
*edit*
There was once a mod around the time Zeppelin came out which did give you a carryable dynamic light. I'm pretty all it did was recalculate the voxel lighting (probably in some optimized way) and then redrew all chunks in which the light level was changed. It overloaded the axis aligned bounding box class, though, so there might have been more to it. For us, it would only be a texture update, which is rather-bandwidth friendly compared to the old way, so that is definitely an option we can consider. However, I wouldn't try it on anything which would require large updates, like changing the position of the sun, or casting ship shadows. That would need to be done with shaders.

 ҉ 
Commodore
Commodore
Posts:1574
Joined:Thu Dec 06, 2012 6:50 am
Affiliation:Kzinti Empire
Location:Kzinhome

Re: Another rendering update

Post by  ҉  » Tue Jan 08, 2013 7:02 pm

I am extremely glad to see that someone actually knows what's going on.
;.'.;'::.;:".":;",,;':",;

(Kzinti script, as best as can be displayed in Human characters, translated roughly as "For the Patriarchy!")

User avatar
fr0stbyte124
Developer
Posts:727
Joined:Fri Dec 07, 2012 3:39 am
Affiliation:Aye-Aye

Re: Another rendering update

Post by fr0stbyte124 » Tue Jan 08, 2013 7:20 pm

Nah, I'm still a novice. Everything I just mentioned would be covered in a beginner's tutorial on shadows. The science and the techniques get so complex it's unbelivable. Game dev's are a breed apart.

User avatar
hyperlite
Lieutenant
Lieutenant
Posts:360
Joined:Thu Dec 06, 2012 3:46 pm

Re: Another rendering update

Post by hyperlite » Tue Jan 08, 2013 7:21 pm

You are saying that you are not a coding master? On a scale of 1-10, what would you say you are?
Spoiler:

User avatar
fr0stbyte124
Developer
Posts:727
Joined:Fri Dec 07, 2012 3:39 am
Affiliation:Aye-Aye

Re: Another rendering update

Post by fr0stbyte124 » Tue Jan 08, 2013 7:47 pm

Depends on who I am being grouped with, and what we are doing. Entry level programming, probably an 8 or 9. Developing a fully-featured game engine from scratch, maybe a 2 or 3. AAA game development, I might be qualified to get them coffee.

Professional engine developers are a seriously amazing bunch. You have to be to stand on the bleeding edge of the latest technology and keep inventing new techniques which could not have even been imagined in previous generations, much less planned for. The rest of us are just collecting the trickle-downs of their experience.
I've created a couple novel techniques, but they are all specifically for working in a minecraft-style cube world, which has never gotten any traction outside of the indie community. I'm not even close to being able to compete with the big boys, or even the bigger little guys.

User avatar
hyperlite
Lieutenant
Lieutenant
Posts:360
Joined:Thu Dec 06, 2012 3:46 pm

Re: Another rendering update

Post by hyperlite » Tue Jan 08, 2013 7:54 pm

Well, I know Notch is credited with coding, but I always here he is not that good at coding, and minecraft is very inefficient and slow for the type of game.

He should be more credited with the idea, not the code itself.
Spoiler:

 ҉ 
Commodore
Commodore
Posts:1574
Joined:Thu Dec 06, 2012 6:50 am
Affiliation:Kzinti Empire
Location:Kzinhome

Re: Another rendering update

Post by  ҉  » Tue Jan 08, 2013 8:07 pm

hyperlite wrote:Well, I know Notch is credited with coding, but I always here he is not that good at coding, and minecraft is very inefficient and slow for the type of game.

He should be more credited with the idea, not the code itself.
Notch is a brilliant game designer, but not a great coder, which is why Minecraft runs so slowly. Jeb is a great coder but an atrocious game designer, which is why every Minecraft update for the past year has sucked more than the previous one.
;.'.;'::.;:".":;",,;':",;

(Kzinti script, as best as can be displayed in Human characters, translated roughly as "For the Patriarchy!")

Chairman_Tiel
Rear Admiral
Rear Admiral
Posts:1890
Joined:Sat Dec 01, 2012 9:39 am
Affiliation:GLORIOUS REPUBLIC

Re: Another rendering update

Post by Chairman_Tiel » Tue Jan 08, 2013 8:13 pm

Last_Jedi_Standing wrote:
hyperlite wrote:Well, I know Notch is credited with coding, but I always here he is not that good at coding, and minecraft is very inefficient and slow for the type of game.

He should be more credited with the idea, not the code itself.
Notch is a brilliant game designer, but not a great coder, which is why Minecraft runs so slowly. Jeb is a great coder but an atrocious game designer, which is why every Minecraft update for the past year has sucked more than the previous one.
That's a nice way of putting it.
[spoiler]Image[/spoiler]

Post Reply