关于三位一体2的渲染(网摘)

Trine 2: Exklusive technical interview - great art design meets amazing lighting

Although Trine 2 hit the market in last December, PC Games Hardware decided to talk to Frozenbyte, the Finnish developers of this amazing game. Juha Hiekkamäki, Senior Graphics Programmer, shared a lot of exclusive information with us about the technical capabilities of Trine 2.
 
Trine 2: Exklusive technical interview [Source: view picture gallery]
Three years ago, Frozenbyte released its amazing first Trine: A platformer with great visuals and a lot of physic puzzles combined with a fantastic soundtrack created by Ari Pulkkinen (well know for Angry Birds). By controlling a knight, a thief and a wizard the player has to combine all their abilities like a burning sword, a bow, and conjuring ramps or chests. For example you have to pour water onto the roots of plants which grow up and in the next moment you fight against some goblins or escape them by reaching a higher stage. In last December the successor Trine 2 hit the shelves within a lot of positive reviews. Just lately we had the opportunity to talk to Juha Hiekkamäki, Senior Graphics Programmer at Frozenbyte.

PCGH: Juha, we have no idea what engine Trine 2 is using - so can you please name it and tell us the API? As far as we know Trine 2 is a cross platform title and utilizes DX9, is that the reason why it does not utilize DX10 or DX11?
Juha Hiekkamäki, Frozenbyte: Trine 2 uses our internal engine and we haven't really given it any name. For graphics API we use D3D9 (and OpenGL on the Mac and Linux). We don't support DX10/DX11 because currently we don't really need them feature-wise. Also, we still have players using Windows XP and upgrading to a newer API would only cost us sales and coding effort for very little benefit. So instead we have focused on getting the most out of DX9 :-)
PCGH: If your engine is build in house and no licensed product, what is the reason for that?
Juha Hiekkamäki, Frozenbyte: Modifying an in house engine to suit your needs is always easier, especially as all of the programmers have been involved on some level in creating the engine, and generally speaking everything is much more straightforward, there's no extra features that would just end up being in the way.

On the other hand, with an inhouse engine it is harder to provide easy-to-use tools for the artists and level designers. That's always a challenge and something that needs to be well-planned, because obviously some tools must always exist very early in each project.

One reason for not using any commercial engine is also the simple fact that paying license fees can quickly add up. Trine 2 supports the major platforms - Windows, Mac, Playstation 3, Xbox 360, and Linux also in the future, so there's a big financial aspect also. In a way using an inhouse engine gives us a certain amount of freedom and independence, and we like that. Or someone else could say that we're just stubborn Finns ...
PCGH: We assume your engine features a Deferred Renderer, could you confirm this and could you please list some advanced rendering techniques you are using?
Juha Hiekkamäki, Frozenbyte: Our rendering is indeed based on deferred rendering, and our typical scene has somewhere between 50 and 100 dynamic lights visible. Compared to some AAA games our feature list is obviously smaller. We are using Depth of Field, screen space reflections, wrap lights (approximation of translucency), bloom and color corrections.We also support native stereoscopic rendering on PC.
PCGH: The lighting and art design of Trine 2 is just amazing - so what is your secret?
Juha Hiekkamäki, Frozenbyte: Our renderer allows artists to use a lot of dynamic lights for each frame. We also try to work together and add some features that would benefit the art. Beyond that, the secret is just our talented art team and the art direction they've chosen :-)
PCGH: You are using Nvidia's PhysX middleware for physics, do you already utilize SDK 3.x? If not, what version is used in Trine 2 and have you integrated any APEX modules? What is your option about GPU accelerated physics?
Juha Hiekkamäki, Frozenbyte: We are using 2.8.x version of PhysX and no additional modules. We decided to stick to the 2.8.x because we've been working with it for a long time and we know it very well, so we didn't want to switch to the just-released 3.0 version at the end of the development cycle.

For Trine 2, it makes very little sense to use GPU acceleration for physics, because with every PC configuration our graphics are heavily GPU limited. CPU is mostly idle, so in our case it's ideal to run physics on the CPU.
PCGH: Trine 2 uses FXAA (Fast Approximate Anti-Aliasing) so which version do you implement? Did you rework any parts of the FXAA code maybe improve sharpness, saturation or contrast?
Juha Hiekkamäki, Frozenbyte: We are using FXAA 3.9, we only changed some values to reduce the blurring effect very slightly. On PC, low graphics settings use console version of FXAA while Medium and above uses high quality default implementation (with gamma correction).
PCGH: One of the greatest features is Supersampling-Anti-Aliasing - in case it scales down a higher render resolution to native resolution, right? Did you integrate SSAA because traditional Multisample-AA is quite difficult with deferred rendering? If we apply SSAA and FXAA in which step will FXAA be rendered - before or after image downscaling?
Juha Hiekkamäki, Frozenbyte: Yes, our super sampling will render the frame in higher resolution and then scale it down to actual output resolution. It was implemented because Multisample-AA is not possible with deferred rendering using D3D9. With D3D10/11 it would be possible to use multisampling to generate G-buffers but in any case lighting would still have to be supersampled. Full supersampling will also help fixing shader aliasing, but it is not very efficient with higher sample amounts.

When combining FXAA and SSAA, we first render the supersampled image, apply FXAA and finally do a gamma-correct scaling down to target resolution. For example for 1920x1080 (1080p) resolution:

2xSSAA+FXAA will render 2550 x 1430 image, apply FXAA and scale it back to 1920x1080.
3xSSAA+FXAA will render 3180 x 1790 image, apply FXAA and scale it back to 1920x1080.
4xSSAA+FXAA will render 3840 x 2160 image, apply FXAA and scale it back to 1920x1080.
PCGH: What is about multicore rendering and worker job system? Does Trine 2 benefit from more than two CPU cores?
Juha Hiekkamäki, Frozenbyte: We don't have a real worker/task system in the engine. However, our middleware (PhysX, Wwise, Bink) can use more than 2 cores.

来自: http://www.pcgameshardware.com/aid,866266/Trine-2-Exklusive-technical-interview-great-art-design-meets-amazing-lighting/News/




Trine 2: Stunning 3D Vision Ready Sequel Launches On Steam

In 2009 the independent Finnish developer, Frozenbyte, released Trine, a fantasy, side-scrolling, platforming-and-puzzling, action-adventure game. Featuring gorgeous graphics, a sense a humor, and an excellent three-player cooperative mode, Trine went on to sell over 1.1 million copies. Today, Frozenbyte has releasedTrine 2 on Steam following a successful beta test for pre-order customers.

This highly anticipated sequel includes three-player online co-op that will allow PC gamers to play with console, Linux and Mac gamers when their respective versions are released, varied level designs, and numerous puzzles and gameplay mechanics, addressing the three most common complaints levied against the original game.

For the sequel, Frozenbyte has taken Trine’s much-lauded, stylized graphics to an entirely new level; a level that will give even the best systems a workout when using the highest possible settings and the game's flawless stereoscopic 3D Vision effects.


In this article we'll examine, compare and contrast the various graphics options available toTrine 2 players, and the impact they make on performance and image quality, starting with the game's detail level presets.

Graphics Detail Levels

Before Trine 2 launches, users are presented with a configuration panel, and on that panel there two options of note: ‘Anti-Aliasing’ and ‘Graphics Detail Level.’

By switching between the five available 'Graphics Detail Level' presets, ten effects, enhancements and performance-saving techniques are lost, gained and modified:

Detail Level Preset Very High High Medium Low Very Low
Shader Quality Very High High Medium Low Very Low
Specular Texture Mipmap Quality Reduction Disabled Disabled Disabled Enabled Enabled
Normal Texture Mipmap Quality Reduction Disabled Disabled Disabled Enabled Enabled
Color Texture Mipmap Quality Reduction Disabled Disabled Disabled Disabled Enabled
Rendering Resolution Reduction Disabled Disabled Disabled Enabled (1x) Enabled (2x)
Half Resolution Textures Disabled Disabled Enabled Enabled Enabled
Distortion Effects Enabled Enabled Enabled Disabled Disabled
Light Glow Enabled Enabled Enabled Enabled Disabled
Flora Sway Enabled Enabled Enabled Enabled Disabled
Anisotropic Filtering 16x 8x 4x 2x 1x

Below, each setting is briefly explained to help you understand their in-game effect:

  • Specular Texture Mipmap Quality Reduction: Reduces the quality of shiny, specular textures by reducing the quality of the associated mipmap, defined as a "pre-calculated, optimized collection of images that accompany a main texture, intended to increase rendering speed and reduce aliasing artifacts."
  • Normal Texture Mipmap Quality Reduction: As above for standard, plain Jane textures.
  • Color Texture Mipmap Quality Reduction: As above for coloured textures.
  • Rendering Resolution Reduction: Originally created for adaptive resolution switching on the consoles, the PC version of this setting permanently reduces the rendering resolution of the scene to a lower value, trading detail for performance (the opposite of SSAA, essentially). Possible settings are 0 (Disabled), 1 (Enabled 1x), 2 (Enabled 2x), and 3 (Enabled 3x), a value that can only be set manually via the options.txt configuration file.
  • Half Resolution Textures: Halves the resolution of all textures to improve performance and reduce VRAM usage.
  • Distortion Effects: Renders heat haze and other such effects in-game.
  • Light Glow: Responsible for the bright, dynamic lighting and effects users would typically refer to as ‘bloom.’
  • Flora Sway: Directs the on-screen flora to sway in the wind.
  • Shader Quality: Determines the quality of the game’s graphics shaders, influencing overall scene quality, lighting quality, reflection quality and other effects.
  • Anisotropic Filtering: Higher values increase the sharpness of textures (a detailed explanation can be foundhere).
关于三位一体2的渲染(网摘)_第1张图片
Click for interactive comparison showing the differences between Very High and Very Low, andclick here for an animated comparison showing all five Graphics Detail Levels.

As shown in the animated comparison, the major shifts in quality occur when moving from High to Medium and Low to Very Low. Between Very High and High the Shader Quality change is noticeable in the detail of the rock’s reflection in the water; between High and Medium the quality of the lighting drops noticeably; between Medium and Low the water’s foam changes dramatically, specular textures are lost, and the quality of the scene’s lighting is lowered once more; and between Low and Very Low the sun’s glow is entirely removed and every single setting reduced to its lowest possible level.

The level of performance gained and lost between the five settings is slight on the most recent graphics cards in our experience. The real performance impact comes from Anti-Aliasing, which we will now examine.

Anti-Aliasing

Unlike the eye-catching changes between the five Graphics Detail Level presets, the effects of Anti-Aliasing are far harder to detect, but no less important. If you’re unfamiliar with the term, Anti-Aliasing is a method for smoothing out a game’s graphics, and in Trine 2 there are two techniques on offer: Fast Approximate Anti-Aliasing (FXAA), and Supersampling Anti-Aliasing (SSAA).

FXAA is a NVIDIA-developed post-processing technique that selectively blurs a game’s graphics to tackle unsightly jagged edges and high-contrast pixel deviation. Gaining popularity amongst developers due to its low performance impact and its ability to anti-alias transparent textures and details, FXAA is highly recommended for low-end and mid-range systems.

Some gamers, however, prefer to maximize the sharpness of a scene, and therefore dislike the blur effect that the technique applies, which by design reduces the sharpness of a game’s graphics to tackle the aforementioned aliasing. To disable FXAA's use inTrine 2 open %APPDATA%/Trine2/options.txt and change setOption(renderingModule, "PostProcessAntiAliasing", true) tosetOption(renderingModule, "PostProcessAntiAliasing", false).

SSAA, on the other hand, is a high-impact, high-quality technique, able to improve image quality and sharpness, and rectify sub-pixel errors by rendering extra detail per pixel of screen data and then downscaling the image back to the user’s chosen resolution. Typically, the less-demanding Multisample Anti-Aliasing (MSAA) would be the counterpart to FXAA, but according to Frozenbyte MSAA is unsuitable for use inTrine 2 due to the game’s rendering method.

As you may have noticed in the launcher image, the Very High Anti-Aliasing option applies both FXAA and SSAA techniques simultaneously to maximize image quality. Be warned, this is extremely demanding and therefore only suitable for the best GPUs. For example, at 1920x1080:

  • 2xSSAA will render a 2550x1430 image, apply FXAA and scale the image back down to 1920x1080.
  • 3xSSAA will render a 3180x1790 image, apply FXAA and scale the image back down to 1920x1080.
  • 4xSSAA will render a 3840x2160 image, apply FXAA and scale the image back down to 1920x1080.

Breaking that down, to play Trine 2 using 4xSSAA with a playable frame rate requires your GPU to literally render the entire scene twice per frame, thirty times per second at minimum, and then apply the FXAA post-process anti-aliasing effect to the result. Unsurprisingly, this requires a tremendous amount of processing power, as we’ll reveal later.

If your system is suitably equipped you can apply even more SSAA by opening%APPDATA%/Trine2/options.txt and editing the AntiAliasSamples value, the max possible setting being16. Higher values will reduce performance further and increase VRAM usage significantly (16xSSAA rendersTrine 2 at 7680x4320, four times the original resolution).

关于三位一体2的渲染(网摘)_第2张图片
Click for an interactive comparison showing 4xSSAA with FXAA enabled and disabled (all screenshots use the Very High Detail preset unless otherwise stated).
关于三位一体2的渲染(网摘)_第3张图片
Click for a second interactive comparison showing 4xSSAA with FXAA enabled and disabled.

As you can see, the difference between FXAA Enabled and Disabled when 4xSSAA is also enabled is negligible in static screenshots, and in-game we found it to be imperceptible. Resorting to pixel analysis, the most noticeable difference can be seen in the first image along the ropes and poles that the birds are sat upon, as this 700% zoomed interactive comparison shows:

关于三位一体2的渲染(网摘)_第4张图片
Note the loss of definition and detail on the rope, poles and water ripples with FXAA enabled.

Below, we compare Anti-Aliasing Off and FXAA Anti-Aliasing:

关于三位一体2的渲染(网摘)_第5张图片
All low-end and mid-range users should attempt to enable FXAA; its effect on image quality is quite dramatic, as is especially noticeable inthis zoomed comparison.

And now, Anti-Aliasing Off and 4xSSAA:


4xSSAA works as intended, eliminating aliased edges throughout the scene, though its secondary function, detail improvement, is hard to spot, only becoming visible in thiszoomed comparison.

As we couldn’t adequately expose SSAA’s ability to dramatically increase scene detail in the previous example we cooked up a special test scenario using the lowest possible setting for everyTrine 2 option, bar Light Glow, which we left enabled:


The power of SSAA is finally revealed through this ludicrous example (no gamer with a GPU capable of using SSAA would ever reduce general detail levels to this extent). Regardless, you can quite visibly see the improvement, even on this full-size screenshot. For consistency’s sake, here’s a zoomed comparison.

Performance

Frozenbyte has stated that Trine 2 is entirely GPU limited, meaning your CPU will have little impact on your performance beyond allowing your graphics card to reach its maximum potential. The minimum required graphics card for the game, a GeForce 7600, is significantly slower than the most popular card on Steam’s Hardware Survey, the 8800/9800, and as such we expect Medium to High settings to produce playable results on the venerable GPU when Anti-Aliasing is disabled.

With a single GeForce GTX 580 we hit the game’s 100 frames per second cap with three characters on-screen using the Very High Detail Level and FXAA Anti-Aliasing. With 4xSSAA and FXAA enabled that figure plunged to between 55 and 60 frames per second, and with just 4xSSAA enabled we recorded frame rates between 60 and 65, revealing the performance impact of FXAA at 1920x1080 to be 10 frames per second. To hit a solid 60 frames per second with both anti-aliasing techniques enabled required a 12% GPU overclock, well within the GTX 580’s limits.

With performance to spare we increased the level of SSAA to determine the Optimal Playable Settings of the stock-clocked GTX 580, but quickly discovered that we could only go as high as 6xSSAA on our 1.5GB card, recording a frame rate of around 35 frames per second (VRAM usage hit 1350MB). In conjunction with our Trine 2 SLI profile, available now through NVIDA Update, 3GB GTX 580s will likely achieve a playable frame rate at 12xSSAA at 1920x1080, though the push to 16xSSAA would surely require the use of a far lower resolution. Given these findings, we set our own test machine to 5xSSAA with FXAA enabled to ensure that the frame rate never dipped below 30 in the game’s most demanding scenes.

关于三位一体2的渲染(网摘)_第6张图片
Click for an interactive comparison showing 4xSSAA versus 6xSSAA, the maximum playable setting on our test system. Pixel analysis shows that there is a minute increase in detail around the egdes of the grass, but nothing truly noticeable.

Throughout our testing we noticed that our GPU utilization remained at 100%, even when our frame rate was hitting the 100 frames per second limiter. Frozenbyte state that this is by design in an attempt to squeeze every last drop of performance from a system’s graphics card. If this is a problem for you, the solution according to Frozenbyte is to limit the game’s frame rate to 60 by enabling VSync in the launcher, or by modifying the game’s Input Lag Reduction value in the manual configuration file referenced earlier. Note that the VSync option also enables Triple Buffering to counteract input lag, and by modifying the Input Lag value in the config file the benefits of Triple Buffering are nullified.

With VSync enabled, each time you press a key or move the mouse there is a small delay between you initiating the action and the result showing on screen. This is known as Input Lag. By default, Direct3D buffers three frames of input data, which can cause a noticeable delay between actions, most readily seen as a ‘lagging’ mouse cursor. InTrine 2, Frozenbyte has changed the default value to two frames, allowing a system’s GPU to be better utilized without introducing noticeable input lag.

To reduce lag and the maximum possible frame rate even further, thereby limiting GPU usage, temperatures and noise output, open%APPDATA%/Trine2/options.txt and change setOption(renderingModule, "ReduceInputLag", false) tosetOption(renderingModule, "ReduceInputLag", true). This is especially useful on low-end systems where input lag will be most noticeable. However, this settingshould not be used in conjunction with VSync, nor should it be enabled on multi-GPU systems. For high-end gamers who dislike screen-tearing we suggest VSync, and for low-end gamers the Input Lag Reduction manual tweak (Frozenbyte have suggest that this tweak will be exposed in-game by way of an update at some point in the future).

3D Vision

Out of the box, the stunningly beautiful Trine 2 includes fantastic stereoscopic 3D Vision support that our 3D Vision developers have labeled ‘3D Vision Ready,’ meaning you receive an excellent NVIDIA-approved experience.

From the moment you load the interactive main menu, scene elements appear from the foreground and background in their own layers, and once you enter the game proper the effects and layered details pop and whizz around, meaningfully enhancing the game’s already stunning graphics.

Trine 2 renders separate scenes for each eye, meaning stereoscopic 3D rendering will double the graphics processing requirements, therefore halving your frame rate. On the same GTX 580 system we were forced to reduce SSAA to 3x to maintain a playable frame rate, a small sacrifice worth making to massively improve immersion and the overall experience.

Conclusion

Our time with Trine 2 has been extremely enjoyable - there’s a mass of replayability to be had in hunting secrets and trying the different characters, the gameplay is great, the online co-op is flawless, the graphics are beautiful, its FXAA implementation peerless, the stereoscopic 3D Vision effects breathtaking, and the game in general fantastic.


来自:http://www.geforce.com/whats-new/articles/trine-2-stunning-3d-vision-ready-sequel-launches-on-steam


rine 2 rendering information - anti-aliasing, overheating, stereo, input lag, etc

开场:This post will give some information on how our rendering works, how to tweak settings and how to troubleshoot some potential problems. There are references to manually editing a configuration file. This can be found from %APPDATA%/Trine2/options.txt. You can edit it by just copy-pasting that path to explorer.


GPU Overheating

Trine 2 is very GPU heavy game. In practice we are never CPU limited, so we are giving the GPU a run for it's money. For some systems, it seems that graphics card will heat up more than in most other games. This is not a problem in our code. We are trying to render our graphics as efficiently as possible, and how each GPU reacts to this load is system specific and we have no control over it. It is hardware and it's drivers responsibility to deal with heat and noise issues. As a first step it's advisable to disable all overclocking features if such are turned on.

There are a few things you can try to reduce the generated heat. It all comes down to artificially limiting the frame rate and thus giving GPU some time to cool down between frames.

Easiest option is to enable vertical sync from the launcher, and make sure game would be running faster than your monitors refresh rate (60 in most cases). Easiest way to gain more performance is to reduce anti-aliasing level (please see section Anti-aliasing).

Alternatively you can enable input lag reduction (please see section Input Lag). Name of the option doesn't sound very intuitive, but as it will reduce your frame rate it will help with cooling problems. This setting used to default on in Trine 1 and early Trine 2 beta.

In the future we are likely to add manual frame rate cap feature.


Performance

If you have performance problems, please check the Anti-aliasing section below. Most performance problems are result of too high SSAA mode being used.


Anti-aliasing

There are two approaches to anti-aliasing in Trine 2, FXAA and supersampling (SSAA). In higher anti-aliasing modes, we use both of these techniques together. Due to how our rendering works, we cannot use traditional MSAA.

FXAA is a post processing filter that 'intelligently' blurs the image trying to get rid of jaggies (and high contrast pixel differencies). It gives really good results for the amount of computing power it uses. However, as it doesn't provide any extra information it cannot address sub-pixel errors.

Supersampling, as the name suggests, improves image quality by rendering more than one pixel worth of data for each pixel that is displayed on monitor. How much extra data there are depends on SSAA mode. As this is a brute-force approach, it is very expensive from performance point of view. If you have performance problems, the first thing to try is to reduce SSAA level from the launcher.

For example for 1920x1080 (1080p) resolution

2xSSAA will render 2550 x 1430 image, apply FXAA and scale it back to 1920x1080.
3xSSAA will render 3180 x 1790 image, apply FXAA and scale it back to 1920x1080.
4xSSAA will render 3840 x 2160 image, apply FXAA and scale it back to 1920x1080.

It is possible to use even higher SSAA modes, but that requires editing %APPDATA%/Trine2/options.txt and changing AntiAliasSamples to higher value (up to 16). Please note that this requires a huge amount of GPU power (1080p with 16x SSAA means rendering 7680x4320 image) and a lot of memory, and for this reason it is not exposed in the launcher.

It is also possible to use SSAA without FXAA by changing
setOption(renderingModule, "PostProcessAntiAliasing", true)
to
setOption(renderingModule, "PostProcessAntiAliasing", false)
from %APPDATA%/Trine2/options.txt.


Input Lag

Input lag is caused by buffering several frames worth of rendering commands. By default, Direct3D will allow buffering of 3 frames worth of data. This causes a very noticeable delay, especially on the lagging mouse cursor. Default behavior in Trine 2 is to limit this buffering to 2 frames, which allows full speed GPU rendering without introducing too much lag. If you want to reduce this lag even more, you can change line
setOption(renderingModule, "ReduceInputLag", false)
to
setOption(renderingModule, "ReduceInputLag", true)
from %APPDATA%/Trine2/options.txt.

This will reduce frame rate somewhat, but it can be useful on lower end systems where it will improve the responsiveness. It will also help to keep your GPU cooler and quieter. This option is not recommended with multi gpu's or with vertical sync. Our vertical sync option will enable triple buffering and this option goes against the benefits gained from that.


Stereoscopic rendering

Currently we support NVIDIA 3D Vision natively. It is likely that we are going to add some other output options later with patches, but we cannot commit to any time frames yet.

3D Vision rendering should get enabled automatically if the game detects valid drivers. If you have 3D Vision on, just launch the game and it should run in 3d. Note that you may have to modify the refresh rate settings from the launcher on some setups to get it working properly (use 120Hz on 120Hz monitors, for example). Currently only 3D Vision hot key that is recognised by the game is stereo on/off toggle (CTRL-T).

In visual settings there are sliders which allow you to tweak separation, convergence and UI depth to suit your preferences.

We render separate views for both eyes, so stereo rendering will double the graphics processing requirements. If you have performance problems, the first step is to reduce anti-aliasing level (please see section Anti-aliasing).

HTH,
Juha,
Your friendly graphics programmer


问:What type of AA Trine 1 uses? Is it supersampling?
Any plans to adding msaa in T1 in the future?

答:I may not be 100% correct on this, but I believe Trine 1 used to use supersampling, and as of 1.08 patch it uses something a bit less taxing on the system (maybe FXAA or something similar). Trine 1 can't use MSAA due to the same reason as Trine 2; we use deferred shading in the renderer.



问:I'd like to know more about your graphics engine. The art direction is amazing and the game is simply too beautiful. But I wonder, how much of this is technical?

Are you guys using a deferred shading renderer (i.e. virtually unlimited light sources)?

How many shadow-casting lights are there?

Screen-space AO or HBAO?

Are you guys using the PhysX engine for your physics simulations?

How high are the texture resolutions?

How many layers are your shaders?

Any simulated SSS shaders for the flora?


答:Look of a game is always down to the art team. In our case even more so, as we don't have a huge budget and thus we have limited feature set. Rendering stuff for all platforms have been done by 1 coder, and few more have had direct influence on it by working on tools / animation system and such. This doesn't leave much time for groundbreaking innovations.

Quote:
Originally Posted by Shaderhacker View Post
Are you guys using a deferred shading renderer (i.e. virtually unlimited light sources)?

How many shadow-casting lights are there?

Screen-space AO or HBAO?

Are you guys using the PhysX engine for your physics simulations?

How high are the texture resolutions?

How many layers are your shaders?

Any simulated SSS shaders for the flora?

-M
We are using deferred shading (we used it in first Trine as well). Only limit for lights affecting solid geometry is performance. Transparent objects can only be affected by 2 lights, though.

Up to 4 of our spots can use shadows (we pick ones covering most screen space in case there are more than that).

No AO.

We are using PhysX.

We are using textures up to 4096 x 4096 resolution. End boss is using one of those, for example. We compress non-transparent textures to dxt1, alpha tested to dxt3 and alpha blended to dxt5. Our normal maps on PC are dxt5, compared to dxt1 on consoles (dxt5 is twice the space but better quality).
Generally per level we don't have that much texture data - comparing PC to console builds we only have 40 textures or so which have been downscaled by dropping the highest mipmap level.

We don't use any real SSS. We use something we call "wrap shaders" which allow artists to tag certain materials (such as flora) to be lit when not facing the light (it's driven by wrap strength, wrap color and light dot normal value).


问:Thanks for this info.

I've got more questions...

How are you able to pull off the 3D stereo using the deferred shading engine (are you just rendering each buffer's left/right eye)? How many G-buffers do you guys use?

We also use a 'wrap lighting' technique for our translucency shaders. Basically evaluating the negative light direction and a scalar multiplied by the color of what the translucency should go to.

Thanks for the details! The game is truly a beauty!


答:For stereo we render both eyes manually. It will cost twice the performance, but it also gives the best results.

We use 3 G-buffers (all 8-bit targets). From memory it goes something like this
1: depth.x, depth.y, normal.x, normal.y (depth is linear, 16bit value encoded to 2 channels)
2: normal.z, albedo.x, albedo.y, albedo.z
3: wrap parameter, fog amount, spec s, spec p
On PC (and PS3) we also render ambient light to 4th render target during g-buffer pass.

I guess the 'wrap lighting' is similar to yours. We encode our wrap parameter (rgb, intensity) to single value (few bits each component) and get it from a look-up texture as it has to be stored in our g-buffer. On lower details we just use a 2d look up (wrap parameter, dot product) to get faster approximation, as there is still some math involved.


问:I'm assuming your albedo is the full color of diffuse without the n dot l.

So your rendering engine isn't even half floating point render target (i.e. 16-bits per channel). Hmm.. colors look astounding.

How about your tone-mapping? I would assume since you are using 8-bit channels, you don't need to store HDR 16Bit textures? You do have a wonderful glow post-process for white light on the characters, but I'm assuming this is just glow and not real tone-mapping. Are you using light maps, btw - or is every light source rendered in realtime? What's your material shader (i.e. Phong, Blinn)? How many post-processing affects are you guys using?

I'd love to see some more variation in each of the characters abilities. For example, Pontius gets a flaming sword, but it would be cool if he could have a special ability with the flaming sword instead of just swinging it (i.e. similar to the hammer throw). Or he could acquire "shield bash" and be able to charge the target. I assume that adding more abilities will require even more variation in puzzles. Just a thought.


答:Yes, everything (besides shadows) is stored in 8-bit buffers and sadly nothing in the rendering is gamma-correct (well, besides AA on higher PC quality settings). This is nice for portability but it does give a quality hit. We do old school add-smooth to add up our lighting while trying to prevent clamping. No HDR/tone mapping here.

Add-smooth is a bit double-edged sword, as it also means many of our scenes don't fully use even the 8-bit precision properly. In fact, we used to do our post-process AA "properly" before post-processing, and it actually meant that AA wasn't really doing much - colors get scaled so much in post-processing. We had to move it after post-processing to actually have a proper effect. As for actual post-processing, we have a simple bloom, dof and some color effects (color factor, brightness, contrast, saturation). In case you are interested, it should be possible to hook up PIX captures for Trine 2. It's not prevented, and it should even have PIX tags to help figuring out what's happening.

We are not using any light maps. All lighting is done real-time. We have from some tens up to a hundred lights visible for a typical scene - for artists to work around the limits in our light model, gamma issues and so on.


问:This looks amazing on PC, well done. How much more detail and effects is the PC version capable of over the PS3 version?

答:Short version is that in PC terms both PS3 and 360 are running medium-ish detail settings in 720p / 30fps / fxaa. Higher PC quality settings mainly improve some shader effects such as reflection, dof, shadows and so on. Besides stereoscopic 3d there are no PC-only features present.


问:































你可能感兴趣的:(关于三位一体2的渲染(网摘))