User Tools

Site Tools


hpl3:engine:rendering

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
hpl3:engine:rendering [2013/10/10 13:13]
ian.thomas
hpl3:engine:rendering [2014/05/20 09:33] (current)
nebej
Line 1: Line 1:
 ==== Rendering ==== ==== Rendering ====
- 
  
 === Environment Particles === === Environment Particles ===
- 
  
 == Overview == == Overview ==
- 
  
 Environment particles is a way of adding a uniform volume of particles that cover an entire world in the engine. It is useful for things like rain, snow and water particles. They way it works is the engine keeps track of a single volume that is then tiled across the entire map. Think of this volume just like a texture that tiles across a large 2D plane. When each particle is reaches the edge of the tiled volume, it wraps a around, thus forming a seamless pattern of particles across the world. When rendered the engine only renders a volume-sized (in our texture analogy, the size a single texture takes up on the plane) at a certain distance from the player. Environment particles is a way of adding a uniform volume of particles that cover an entire world in the engine. It is useful for things like rain, snow and water particles. They way it works is the engine keeps track of a single volume that is then tiled across the entire map. Think of this volume just like a texture that tiles across a large 2D plane. When each particle is reaches the edge of the tiled volume, it wraps a around, thus forming a seamless pattern of particles across the world. When rendered the engine only renders a volume-sized (in our texture analogy, the size a single texture takes up on the plane) at a certain distance from the player.
  
- +[[:​hpl3:​engine:​envparticles.jpg|envparticles.jpg]]
-[[envparticles.jpg]] ​ +
  
 This volume is a chunk of the entire tiled volume so as the camera moves around in the environment. This chunk can then be rendered several times, each time with a randomized offset to positions and rotations, in order to create a dense collection of particles. All this is done on the GPU and is really fast. There is no problem with having the basic volume filled with 1000 particles, and then have 10 iterations, giving a total of 10k particles. The main bottle neck is probably overdraw, so the feature is best suited for smaller particles that do not cover much of the screen (and seldom cover each other). This volume is a chunk of the entire tiled volume so as the camera moves around in the environment. This chunk can then be rendered several times, each time with a randomized offset to positions and rotations, in order to create a dense collection of particles. All this is done on the GPU and is really fast. There is no problem with having the basic volume filled with 1000 particles, and then have 10 iterations, giving a total of 10k particles. The main bottle neck is probably overdraw, so the feature is best suited for smaller particles that do not cover much of the screen (and seldom cover each other).
- 
  
 == Settings == == Settings ==
  
- +**ParticleNum** \\
-**ParticleNum** \\ +
 The number of particles in side the volume. The number of particles in side the volume.
  
- +**BoxSize** \\
-**BoxSize** \\ +
 The sized of the tiled volume containing the particles. The sized of the tiled volume containing the particles.
  
- +**SubDivUV** \\
-**SubDivUV** \\ +
 The number of sub textures inside the texture for the particles. 2×2 means a that 4 sub textures are randomized between all particles. The number of sub textures inside the texture for the particles. 2×2 means a that 4 sub textures are randomized between all particles.
  
- +**ParticleSize** \\
-**ParticleSize** \\ +
 The size of the particles. Remember not to make them too large if many are required. The size of the particles. Remember not to make them too large if many are required.
  
- +**AffectedByLight** \\
-**AffectedByLight** \\ +
 If the particles should be affected by light in the scene. The way this works is that 3 light probes (one close to the camera, 2 further away) gather light-amount from lights that intersect with them. These three values are then interpolated between for each light. It is not perfect, but does a decent job. If the particles should be affected by light in the scene. The way this works is that 3 light probes (one close to the camera, 2 further away) gather light-amount from lights that intersect with them. These three values are then interpolated between for each light. It is not perfect, but does a decent job.
  
- +**BoxDistance** \\
-**BoxDistance** \\ +
 The distance from the player at which the volume is rendered. The distance from the player at which the volume is rendered.
  
- +**FadeInStart**,​ **FadeInEnd**,​ **FadeOutStart**,​ **FadeOutEnd** \\
-**FadeInStart**,​ **FadeInEnd**,​ **FadeOutStart**,​ **FadeOutEnd** \\ +
 Parameters for how the particles in the rendered volume fade in out. All distant are measured as z-distance from camera. Parameters for how the particles in the rendered volume fade in out. All distant are measured as z-distance from camera.
  
- +**IterationNum** \\
-**IterationNum** \\ +
 The number of particles that If it has a fraction (eg 13.45), the fractional part (eg 0.45) determines the alpha of the last iteration. (to allows fading iterations) The number of particles that If it has a fraction (eg 13.45), the fractional part (eg 0.45) determines the alpha of the last iteration. (to allows fading iterations)
  
- +**Color** \\
-**Color** \\ +
 The color the particles are modulated by. The color the particles are modulated by.
  
- +**GravityVelocity**,​ **WindVelocity** \\
-**GravityVelocity**,​ **WindVelocity** \\ +
 Two different velocity values for each of the particles. Two different velocity values for each of the particles.
  
- +**RotateVelocity** \\
-**RotateVelocity** \\ +
 The speed at which the particles rotate around the center of the volume. The speed at which the particles rotate around the center of the volume.
  
- +**GravitySpeedRandomAmount**,​ **WindSpeedRandomAmount**,​ **WindDirectionRandomAmount**,​**RotateSpeedRandomAmount** \\ 
-**GravitySpeedRandomAmount**,​ **WindSpeedRandomAmount**,​ **WindDirectionRandomAmount**,​**RotateSpeedRandomAmount** \\  +The random variations are added to any iterations after the first! Valid values for all amounts are 0 - 1 (can be others, but not recommended).\\ 
-The random variations are added to any iterations after the first! Valid values for all amounts are 0 - 1 (can be others, but not recommended).\\  +What it does it that any subsequent iterations will have the vector updated like: vector + vector<​nowiki>​*</​nowiki>​random amount. So if the vector is (0,1,0.1) and if the random amount is 0.1, then any subsequent iterations will have values between (0, 0.9, 0.09) - (0, 1.1, 0.11). Wind direction random is a bit different, what is does is that it rotates the vector (around all axes) by around amount. Wind random amount of 1 means, it can rotate into any direction of a sphere, 0.5 means half a sphere, 0.25, quarter of a sphere and so on.\\
-What it does it that any subsequent iterations will have the vector updated like: vector + vector<​nowiki>​*</​nowiki>​random amount. So if the vector is (0,1,0.1) and if the random amount is 0.1, then any subsequent iterations will have values between (0, 0.9, 0.09) - (0, 1.1, 0.11). Wind direction random is a bit different, what is does is that it rotates the vector (around all axes) by around amount. Wind random amount of 1 means, it can rotate into any direction of a sphere, 0.5 means half a sphere, 0.25, quarter of a sphere and so on.\\ +
 Also note that the random values are psuedo-random,​ this means that they do not change depending on play through, but they are always they same. So if it looks like something in the editor, the random distribution will look exactly the same when you view it later in the game. Also note that the random values are psuedo-random,​ this means that they do not change depending on play through, but they are always they same. So if it looks like something in the editor, the random distribution will look exactly the same when you view it later in the game.
  
- +**RotateSpeedRandomBothDirs** \\
-**RotateSpeedRandomBothDirs** \\ +
 If the rotations can go the opposite direction too. If the rotations can go the opposite direction too.
- 
  
 === Lens Flares === === Lens Flares ===
- 
  
 == Overview == == Overview ==
  
- +Lens flares are a bright spot that appear at the center of a strong light source.\\
-Lens flares are a bright spot that appear at the center of a strong light source.\\ ​+
 Lens flares are created by light entering through a camera objective and reflecting multiple times off the surface of the numerous lenses inside it, creating several recognizable artifacts. Lens flares are created by light entering through a camera objective and reflecting multiple times off the surface of the numerous lenses inside it, creating several recognizable artifacts.
- 
  
 The [[:​hpl3:​engine:​envparticles.jpg|Adobe Flash Plugin]] is needed to display this content. The [[:​hpl3:​engine:​envparticles.jpg|Adobe Flash Plugin]] is needed to display this content.
- 
  
 == Flare Types == == Flare Types ==
  
- +[[:​hpl3:​engine:​envparticles.jpg|lens_flares.png]] \\
-[[:​hpl3:​engine:​envparticles.jpg|lens_flares.png]] \\ +
 Each lens flare consists of a few different kind of flare types that can be active at the same time. Each lens flare consists of a few different kind of flare types that can be active at the same time.
  
- +**Flare** \\
-**Flare** \\ +
 A normal flare that rotates slightly depending on its position on the screen. A normal flare that rotates slightly depending on its position on the screen.
  
- +**Anamorphic flare** \\ 
-**Anamorphic flare** \\  +A flare that stretches in either horizontal or vertical direction. The anamorphic flare stretches out more the closer it gets to the edge of the screen.\\ 
-A flare that stretches in either horizontal or vertical direction. The anamorphic flare stretches out more the closer it gets to the edge of the screen.\\  +**Multi Iris** \\
-**Multi Iris** \\ +
 A line of small iris shaped artifacts stretching toward and away from center of the screen. The brightness/​size/​sub-texture of each individual iris is randomly determined by the seed of the flare. A line of small iris shaped artifacts stretching toward and away from center of the screen. The brightness/​size/​sub-texture of each individual iris is randomly determined by the seed of the flare.
- 
  
 == Flare Type Settings == == Flare Type Settings ==
  
- +**Material** \\ 
-**Material** \\  +The material of the flare type. Additive blend and depth test disabled are recommended for best result.\\ 
-The material of the flare type. Additive blend and depth test disabled are recommended for best result.\\  +**Color** \\ 
-**Color** \\  +**Size** \\
-**Size** \\ +
 The size of the flare type. A value of 1.0 means that it covers the whole screen. The size of the flare type. A value of 1.0 means that it covers the whole screen.
- 
  
 == General Settings == == General Settings ==
  
- +**Outer Field of View** \\ 
-**Outer Field of View** \\  +The angle in degrees of which the flare should be visible. The brightness fades from 0-100% between Outer and Inner Field of View.\\ 
-The angle in degrees of which the flare should be visible. The brightness fades from 0-100% between Outer and Inner Field of View.\\  +**Inner Field of View** \\ 
-**Inner Field of View** \\  +The angle in degrees of which the flare should have full brightness.\\ 
-The angle in degrees of which the flare should have full brightness.\\  +**Min Range** \\ 
-**Min Range** \\  +The minimum range for when the lens flare is visible. A value of -1 means that the camera can never be to close.\\ 
-The minimum range for when the lens flare is visible. A value of -1 means that the camera can never be to close.\\  +**Max Range** \\ 
-**Max Range** \\  +The maximum range for when the lens flare is visible. A value of -1 means that the lens flare has an unlimited range.\\ 
-The maximum range for when the lens flare is visible. A value of -1 means that the lens flare has an unlimited range.\\  +**Size change based on distance** \\
-**Size change based on distance** \\ +
 A real value between 0-1 that determines how much the screen size of the lens flare should change the further away it gets. A value of 0 means that the flare always has same size on the screen. A real value between 0-1 that determines how much the screen size of the lens flare should change the further away it gets. A value of 0 means that the flare always has same size on the screen.
- 
  
 == Glare Settings == == Glare Settings ==
- 
  
 Lens flares can be used to blind the camera. Either if the camera is looking directly at the lens flare or if the lens flare is pointed toward the camera. Lens flares can be used to blind the camera. Either if the camera is looking directly at the lens flare or if the lens flare is pointed toward the camera.
  
- +**Glare Brightness** \\ 
-**Glare Brightness** \\  +How much the camera will be blinded.\\ 
-How much the camera will be blinded.\\  +**Glare Stare At** \\ 
-**Glare Stare At** \\  +How blinded the camera will be by looking directly at the lens flare.\\ 
-How blinded the camera will be by looking directly at the lens flare.\\  +**Glare Field of View** \\ 
-**Glare Field of View** \\  +The angle in degrees of which the lens flare should blind the camera. The camera will be more blinded the more the lens flare pointed at the camera.\\ 
-The angle in degrees of which the lens flare should blind the camera. The camera will be more blinded the more the lens flare pointed at the camera.\\  +**Glare Range** \\
-**Glare Range** \\ +
 How close the lens flare has to be to blind the camera. The glare brightness fades out between the minimum and maximum value. A value of -1 means unlimited range. How close the lens flare has to be to blind the camera. The glare brightness fades out between the minimum and maximum value. A value of -1 means unlimited range.
- 
  
 == Multi Iris Settings == == Multi Iris Settings ==
  
- +**Mul MultiIris with Glare** \\ 
-**Mul MultiIris with Glare** \\  +Toggles whether the strength of the Multi Iris line should be affected by the glare amount.\\ 
-Toggles whether the strength of the Multi Iris line should be affected by the glare amount.\\  +**MultiIris Count** \\ 
-**MultiIris Count** \\  +The number of irises in the Multi Iris line.\\ 
-The number of irises in the Multi Iris line.\\  +**MultiIris texture atlas grid** \\ 
-**MultiIris texture atlas grid** \\  +The material for the Multi Iris line can be a texture atlas with many small sub-textures on it. The texture grid selects how many sub-textures there are and how they are divided on the texture atlas. A texture with the size 128×128 and a sub-texture size of 64×64 would have a value of (2,2).\\
-The material for the Multi Iris line can be a texture atlas with many small sub-textures on it. The texture grid selects how many sub-textures there are and how they are divided on the texture atlas. A texture with the size 128×128 and a sub-texture size of 64×64 would have a value of (2,​2).\\ ​+
 {{:​hpl3:​engine:​multi_iris.png?​nolink&​}} {{:​hpl3:​engine:​multi_iris.png?​nolink&​}}
- 
  
 == Occlusion Settings == == Occlusion Settings ==
  
- +**Shrink when Occluded** \\ 
-**Shrink when Occluded** \\  +Toggles whether the lens flare should shrink or fade out when it gets occluded.\\ 
-Toggles whether the lens flare should shrink or fade out when it gets occluded.\\  +**Source Size** \\ 
-**Source Size** \\  +3D Vector storing the size of the occluder for the lens flare. Will be displayed as a green wireframe box.\\ 
-3D Vector storing the size of the occluder for the lens flare. Will be displayed as a green wireframe box.\\  +**Use parent mesh for occlusion** \\
-**Use parent mesh for occlusion** \\ +
 Uses the mesh of the parent instead of the Source Size box as an occluder. Uses the mesh of the parent instead of the Source Size box as an occluder.
- 
  
 === Gamma Correction === === Gamma Correction ===
- 
  
 == Overview == == Overview ==
  
- +There are two types of gamma correction. The first one makes sure that the image is displayed correctly on a computer screen. The luminance of a computer monitor is not linear, to compensate this gamma correction is applied to each pixel. This is done by adjusting the curve of the image to make all the pixels brighter, the shadows get affected the most and the highlights the least. When the image gets displayed on the monitor the inverse curve is applied and all the pixels are displayed at their original luminance. ​ This is something that is done automatically by digital cameras and applications like Photoshop. \\
-There are two types of gamma correction. The first one makes sure that the image is displayed correctly on a computer screen. The luminance of a computer monitor is not linear, to compensate this gamma correction is applied to each pixel. This is done by adjusting the curve of the image to make all the pixels brighter, the shadows get affected the most and the highlights the least. When the image gets displayed on the monitor the inverse curve is applied and all the pixels are displayed at their original luminance. ​ This is something that is done automatically by digital cameras and applications like Photoshop. \\ +
 {{:​hpl3:​engine:​gammalines-small.png?​nolink&​200}} {{:​hpl3:​engine:​gammalines-small.png?​nolink&​200}}
- 
  
 The second type of gamma correction makes sure that all light calculations are perform in linear-space. Since textures created in Photoshop are saved in gamma space they need to be converted to linear-space before lighting is applied to them. This is done by applying the inverse curve that the monitor uses and then multiplying it with the color and brightness of the light source. The second type of gamma correction makes sure that all light calculations are perform in linear-space. Since textures created in Photoshop are saved in gamma space they need to be converted to linear-space before lighting is applied to them. This is done by applying the inverse curve that the monitor uses and then multiplying it with the color and brightness of the light source.
- 
  
 == Links == == Links ==
  
- +[[:​hpl3:​engine:​envparticles.jpg|What is Gamma?]] [[:​hpl3:​engine:​envparticles.jpg|Linear-Space Lighting]] [[:​hpl3:​engine:​envparticles.jpg|Gamma Correction and Gamma Correction]]
-[[:​hpl3:​engine:​envparticles.jpg|What is Gamma?]] [[:​hpl3:​engine:​envparticles.jpg|Linear-Space Lighting]] [[:​hpl3:​engine:​envparticles.jpg|Gamma Correction and Gamma Correction]] ​ +
  
 === HDR Rendering === === HDR Rendering ===
- 
  
 == Overview == == Overview ==
  
- +A normal computer monitor can display display colors in the range of (0-255) per color channel. This adds up to around 16.77 million unique colors.\\ 
-A normal computer monitor can display display colors in the range of (0-255) per color channel. This adds up to around 16.77 million unique colors.\\  +With HDR Rendering the number of colors per channel is increased to 65565. This is increases the precision and quality of dark/grey tones and it also gives the ability to have colors that are brighter than the monitor can display.\\
-With HDR Rendering the number of colors per channel is increased to 65565. This is increases the precision and quality of dark/grey tones and it also gives the ability to have colors that are brighter than the monitor can display.\\ ​+
 Having colors that are brighter then what the monitor can display would be a waste. A technique called Tone Mapping is applied to the high precision color to covert it to a range between (0-255) so that the monitor can display it. Having colors that are brighter then what the monitor can display would be a waste. A technique called Tone Mapping is applied to the high precision color to covert it to a range between (0-255) so that the monitor can display it.
- 
  
 All light have a brightness setting so that they can be brighter then 1. The overall range of the brightness of a level should be around (0-10) for best result. Before HDR was implemented it was a in the range of (0-1). You can think of light brightness as light bulb energy. A brightness of 6 = 60 W, 4 = 40W. All light have a brightness setting so that they can be brighter then 1. The overall range of the brightness of a level should be around (0-10) for best result. Before HDR was implemented it was a in the range of (0-1). You can think of light brightness as light bulb energy. A brightness of 6 = 60 W, 4 = 40W.
- 
  
 == Tone Mapping == == Tone Mapping ==
- 
  
 Tone Mapping is a technique to convert colors from high precsion to colors visible on the monitor. The algorithm starts by scaling the luminance of the image by the exposure of the camera, making the whole image darker or brighter. ​ It then uses a function to map data in the domain of (0-Unlimited) to values between (0-1). The function used in the engine is called called Uncharted Tone Mapping, from the game Uncharted 2. It increases the contrast of the image by making the dark colors darker and smoothing out the highlights. After that all colors are scaled by a white point, clamping all colors above the white point to 1. Tone Mapping is a technique to convert colors from high precsion to colors visible on the monitor. The algorithm starts by scaling the luminance of the image by the exposure of the camera, making the whole image darker or brighter. ​ It then uses a function to map data in the domain of (0-Unlimited) to values between (0-1). The function used in the engine is called called Uncharted Tone Mapping, from the game Uncharted 2. It increases the contrast of the image by making the dark colors darker and smoothing out the highlights. After that all colors are scaled by a white point, clamping all colors above the white point to 1.
- 
  
 == Variables == == Variables ==
  
- +**MiddleGrey** | A real value that sets what should be considered the middle grey value.\\ 
-**MiddleGrey** | A real value that sets what should be considered the middle grey value.\\  +**Exposure** | The total light that is allowed through the camera, increasing this value makes the image brighter. In the range of -10 to +10.\\
-**Exposure** | The total light that is allowed through the camera, increasing this value makes the image brighter. In the range of -10 to +10.\\ ​+
 **WhitePoint** | A real value that sets which value that should be considered the brightest. **WhitePoint** | A real value that sets which value that should be considered the brightest.
 === Exposure Area === === Exposure Area ===
- 
  
 == Overview == == Overview ==
- 
  
 A area that changes the tone mapping parameters when entered. Used to simulate automatic correction of exposure that occurs when eyes get used to bright/dim lit environments. A area that changes the tone mapping parameters when entered. Used to simulate automatic correction of exposure that occurs when eyes get used to bright/dim lit environments.
- 
  
 == Variables == == Variables ==
  
- +**Position** | The world position of the trigger area.\\ 
-**Position** | The world position of the trigger area.\\  +**Size** | The size of the area that triggers the change.\\ 
-**Size** | The size of the area that triggers the change.\\  +**Exposure** | The total light that is allowed through the camera, increasing this value makes the image brighter. In the range of -10 to +10.\\ 
-**Exposure** | The total light that is allowed through the camera, increasing this value makes the image brighter. In the range of -10 to +10.\\  +**WhitePoint** | A real value that sets which value that should be considered the brightest.\\
-**WhitePoint** | A real value that sets which value that should be considered the brightest.\\ ​+
 **TransitionTime** | The time it takes for the new exposure to apply. **TransitionTime** | The time it takes for the new exposure to apply.
 === Color Grading === === Color Grading ===
- 
  
 == Overview == == Overview ==
  
- +Color grading is a way to map the color of a pixel to another color. This can be used to change the brightness, contrast, hue, saturation, … of a whole image.\\ 
-Color grading is a way to map the color of a pixel to another color. This can be used to change the brightness, contrast, hue, saturation, … of a whole image.\\  +It is possible to smoothly fade between two different grading templates.\\ 
-It is possible to smoothly fade between two different grading templates.\\  +It uses a small 3D texture with a color as input and another color as output.\\ 
-It uses a small 3D texture with a color as input and another color as output.\\  +[[:​http:​www.adobe.com:​products:​flashplayer:​start|grading.jpg]]
-[[:​http:​www.adobe.com:​products:​flashplayer:​start|grading.jpg]] ​ +
  
 == Creation Guide == == Creation Guide ==
  
- +**Requirements**
-**Requirements** ​ +
  
     * Photoshop     * Photoshop
-    * [[https://​developer.nvidia.com/​nvidia-texture-tools-adobe-photoshop|NVIDIA Texture Tools for Adobe Photoshop]] ​ +    * [[https://​developer.nvidia.com/​nvidia-texture-tools-adobe-photoshop|NVIDIA Texture Tools for Adobe Photoshop]]
- +
- +
-**Setup** ​+
  
 +**Setup**
  
     - Take a screenshot of the game with color grading disabled     - Take a screenshot of the game with color grading disabled
Line 262: Line 199:
     - Select "Image > Mode > 16 Bits/​Channel"​ in the top menu     - Select "Image > Mode > 16 Bits/​Channel"​ in the top menu
  
- +**Adjustments**
-**Adjustments** ​ +
  
     * Use any of the options in "Image > Adjustments"​     * Use any of the options in "Image > Adjustments"​
     * These can be used to change the brightness, saturation, contrast and so on     * These can be used to change the brightness, saturation, contrast and so on
     * Any changes you see on the image in Photoshop will carry over to the game     * Any changes you see on the image in Photoshop will carry over to the game
- 
  
 [[:​hpl3:​engine:​grading.jpg|{{:​hpl3:​engine:​adjustments.jpg?​nolink&​200]] }} [[:​hpl3:​engine:​grading.jpg|{{:​hpl3:​engine:​adjustments.jpg?​nolink&​200]] }}
  
- +**Layers**
-**Layers** ​ +
  
     * It is also possible to use the any of the layer blend modes     * It is also possible to use the any of the layer blend modes
     * There are two kinds of layers allowed:     * There are two kinds of layers allowed:
- 
  
     - Solid color     - Solid color
     - Dupilcate of the first layer     - Dupilcate of the first layer
- 
  
     * It is possible to duplicate the first layer and make adjustments to it and then blend it     * It is possible to duplicate the first layer and make adjustments to it and then blend it
     * The use of Layer Masks is allowed as long as they are generated from the image and not hand painted     * The use of Layer Masks is allowed as long as they are generated from the image and not hand painted
- 
  
 {{:​hpl3:​engine:​layers.jpg?​nolink&​200}} {{:​hpl3:​engine:​layers.jpg?​nolink&​200}}
  
- +**Saving**
-**Saving** ​ +
  
     - Crop the color strip from the canvas, make sure the resulting image is 256×16 px     - Crop the color strip from the canvas, make sure the resulting image is 256×16 px
     - Select "Save As…" and set the format as "​D3D/​DDS"/"​.dds"​ and save it in the folder "​redist/​textures/​colorgrading/"​     - Select "Save As…" and set the format as "​D3D/​DDS"/"​.dds"​ and save it in the folder "​redist/​textures/​colorgrading/"​
-    - In the DDS format settings select "​8.8.8 ​RGB 24 bit | unsigned",​ "​Volume Texture",​ "No MIP maps" +    - In the DDS format settings select "8.8.8.8 RGBA 32 bit | unsigned",​ "​Volume Texture",​ "No MIP maps" ​(Ignore the picture, use 32 bpp!)
  
 {{:​hpl3:​engine:​dds_format.jpg?​nolink&​}} \\ {{:​hpl3:​engine:​crop.jpg?​nolink&​400}} {{:​hpl3:​engine:​dds_format.jpg?​nolink&​}} \\ {{:​hpl3:​engine:​crop.jpg?​nolink&​400}}
- 
  
 === Billboard Group === === Billboard Group ===
- 
  
 == Overview == == Overview ==
  
- +A group with multiple billboards. Batching them together and rendering them at the same time.     ​\\ All the billboards in a group must have the same material, but all other parameters can be different. ​    ​\\ Alpha sorting is performed internally within the group. But alpha sorting with external billboards and billboard groups is performed as usual. Because of this the billboards in agroup should not be to spread out, a maximum radius of 5-10m is recommended. ​    ​\\ When selected the Billboard Group will show the combinded bounding volume of all the billboards.
-A group with multiple billboards. Batching them together and rendering them at the same time.    \\ All the billboards in a group must have the same material, but all other parameters can be different. ​   \\ Alpha sorting is performed internally within the group. But alpha sorting with external billboards and billboard groups is performed as usual. Because of this the billboards in agroup should not be to spread out, a maximum radius of 5-10m is recommended. ​   \\ When selected the Billboard Group will show the combinded bounding volume of all the billboards. +
  
 == Settings == == Settings ==
  
- +**Material** ​     | The material which will be used to render all the billboards in the group.
-**Material** ​    ​| The material which will be used to render all the billboards in the group. +
  
 === Liquid Trickle === === Liquid Trickle ===
- 
  
 == Overview == == Overview ==
- 
  
 A shader effect to simulate liquid spreading out over an object. The amount of liquid is controlled by a texture and a variable called LiquidAmount. The variable can be set via scripting or be updated automatically over time. The texture is used to mask out where the liquid can spread and in which order it spreads, it is also used to determine how the liquid fades away. A shader effect to simulate liquid spreading out over an object. The amount of liquid is controlled by a texture and a variable called LiquidAmount. The variable can be set via scripting or be updated automatically over time. The texture is used to mask out where the liquid can spread and in which order it spreads, it is also used to determine how the liquid fades away.
- 
  
 == Texture == == Texture ==
- 
  
 To create a liquid texture map two color channels must be used. The red channel is a gradient mask that controls where the liquid spreads and the order of the spread. The brighter the pixel is the earlier it is covered in liquid. If the pixel is set to (0,0,0) the liquid will be completely masked. The green channel is used to determine in which order the liquid will fade out. Fading out can be turned off in the material editor. To create a liquid texture map two color channels must be used. The red channel is a gradient mask that controls where the liquid spreads and the order of the spread. The brighter the pixel is the earlier it is covered in liquid. If the pixel is set to (0,0,0) the liquid will be completely masked. The green channel is used to determine in which order the liquid will fade out. Fading out can be turned off in the material editor.
- 
  
 {{  :​hpl3:​engine:​fade_in_out.jpg?​nolink& ​ }} {{  :​hpl3:​engine:​fade_in_out.jpg?​nolink& ​ }}
- 
  
 When saving the texture it should be exported as a compressed 3dc dds. If the quality for the texture is not good enough then the texture can be saved as a tga, for this to work the red channel has to be copied in to the alpha channel and the green channel to the blue channel. When saving the texture it should be exported as a compressed 3dc dds. If the quality for the texture is not good enough then the texture can be saved as a tga, for this to work the red channel has to be copied in to the alpha channel and the green channel to the blue channel.
- 
  
 == Scripting == == Scripting ==
  
- +For some effects the liquid amount can be controlled automatically by the time. But scripting can be used to create some other interesting effects. One effect could be to set the LiquidAmount variable to correspond to how much of an object is below the water surface and then slowly lower the LiquidAmount to simulate it drying. Scripting can also be used for showing blood when a character is hurt or if oil starts leaking when triggering a trap.      \\ When a material should work with scripting it is a good idea to set the LiquidTrickleFadeIn parameter to 1 so that the LiquidAmount variable works as percentage instead of time.
-For some effects the liquid amount can be controlled automatically by the time. But scripting can be used to create some other interesting effects. One effect could be to set the LiquidAmount variable to correspond to how much of an object is below the water surface and then slowly lower the LiquidAmount to simulate it drying. Scripting can also be used for showing blood when a character is hurt or if oil starts leaking when triggering a trap.     ​\\ When a material should work with scripting it is a good idea to set the LiquidTrickleFadeIn parameter to 1 so that the LiquidAmount variable works as percentage instead of time. +
  
 === Depth of Field === === Depth of Field ===
- 
  
 == Overview == == Overview ==
- 
  
 Depth of Field describes which part of the screen should be in focus and sharp. DOF is the distance between the nearest and farthest object in the scene that should appear sharp. Depth of Field describes which part of the screen should be in focus and sharp. DOF is the distance between the nearest and farthest object in the scene that should appear sharp.
- 
  
 == Settings == == Settings ==
  
 +**Focus Start** ​    | The nearest distance to the camera that an object has to be to be sharp. Any closer and it will be blurry
  
-**Focus ​Start**    | The nearest distance to the camera that an object ​has to be to be sharp. Any closer ​and it will be blurry+**Focus ​End **     ​| The farthest away an object ​can be and still be sharp. Any further away and it will start getting ​blurry
  
 +**Falloff **     | How fast the object should get blurry when it is closer or further away then the focus plane. The blur distance is caluclated as (Focus End - Focus Start) / Falloff
  
-**Focus End **    | The farthest away an object can be and still be sharp. Any further away and it will start getting blurry +{{:​hpl3:​engine:​depth_of_field_diagram.png?​nolink&​518x174}}
- +
- +
-**Falloff **    | How fast the object should get blurry when it is closer or further away then the focus plane. The blur distance is caluclated as (Focus End - Focus Start) / Falloff +
- +
- +
-[[:​hpl3:​engine:​grading.jpg|{{:​hpl3:​engine:​depth_of_field_diagram.png?​nolink&​518x174}}]]  +
  
 === Distance Culling === === Distance Culling ===
- 
  
 == Overview == == Overview ==
- 
  
 Removal of objects that get to far away from the camera. Objects are removed based on how big they appear on the screen. The objects are gradually faded out until they are removed. Solid objects dissolve and translucent objects have their alpha faded. Removal of objects that get to far away from the camera. Objects are removed based on how big they appear on the screen. The objects are gradually faded out until they are removed. Solid objects dissolve and translucent objects have their alpha faded.
- 
  
 The default setting is that all objects are faded out when distance culling is activated. Important objects and objects that make up the silhouette of the level should have distance culling turned off. The default setting is that all objects are faded out when distance culling is activated. Important objects and objects that make up the silhouette of the level should have distance culling turned off.
- 
  
 Distance culling should only be activated on outdoor levels where occlusion culling is not as effective. Distance culling should only be activated on outdoor levels where occlusion culling is not as effective.
- 
  
 == Settings == == Settings ==
  
 +**Distance Cull Active** ​ | If distance culling should be used on this level
  
-**Distance Cull Active** | If distance culling should be used on this level +**Distance Cull Min Range **  | The minimum range before objects start fading out. This is important to set so that very small objects dont get culled to early
- +
- +
-**Distance Cull Min Range ** | The minimum range before objects start fading out. This is important to set so that very small objects dont get culled to early +
- +
- +
-**Distance Cull Screen Size ** | How small an object has to be in screen size to be culled. A real value between 0.0 - 1.0. If set to 0.1 then any object that is smaller then 10% of the height of the screen will get culled+
  
 +**Distance Cull Screen Size **  | How small an object has to be in screen size to be culled. A real value between 0.0 - 1.0. If set to 0.1 then any object that is smaller then 10% of the height of the screen will get culled
  
-**Distance Cull Random Size ** | A random value unique to each object that is added to the screen size. This shoudl be used so that not all objects of the same size are removed at the same range+**Distance Cull Random Size **  | A random value unique to each object that is added to the screen size. This shoudl be used so that not all objects of the same size are removed at the same range
  
 +**Culled By Distance **  | A variable set per object that specifies if the object should be affected by distance culling
  
-**Culled By Distance ** | A variable set per object that specifies if the object should be affected by distance culling 
hpl3/engine/rendering.txt · Last modified: 2014/05/20 09:33 by nebej