Daydream Renderer 是一组脚本和着色器,旨在在 Daydream 平台上实现高质量的实时渲染,目标帧率为 60fps。
Daydream Renderer 是一组脚本和着色器,旨在在 Daydream 平台上实现高质量的实时渲染,目标帧率为 60fps。
Daydream Renderer is a set of scripts and shaders designed to allow for high quality real-time rendering on the Daydream platform targeting 60fps. For a high level overview about the Daydream Renderer, please visit: https://developers.google.com/vr/unity/renderer.
To use the renderer, download the unity package from the releases page and import into your project (Assets > Import Package > Custom Package…).
Every scene using Daydream Renderer must have a root level object with a DaydreamRenderer script component. If you’re converting an existing scene with the Import Wizard, this will be added automatically.
Daydream Renderer functionality is exposed via the following:
If you have an existing project, Daydream Renderer offers a tool called the Import Wizard to let you separately convert the lighting to Daydream Renderer Lighting and the materials to Daydream Renderer shaders.
You can find the Import Wizard under Window > Daydream Renderer > Import Wizard.
Daydream Renderer can utilize a custom lighting system to provide lighting data to shaders. For the best work-flow experience, check the ‘Enable Daydream Lighting System‘ option.
With the ‘Auto add Daydream lighting components in Scene’ option enabled, all lights in your scene will be automatically kept compatible with the Daydream Renderer lighting system.
You may optionally convert lights in all assets within the project by clicking the ‘Add to Project Assets’ button.
Note: There is a known issue where you have to run your scene at least once before Daydream Renderer lighting start to work.
The Material Wizard assists in converting an existing scene over to Daydream materials. It applies a conversion process to preserve all the feature selections of the original Unity shader but converted to the Daydream standard shader.
You can click Scan Materials to see how many dynamic and static objects that exist within the scene that need converting to Daydream Renderer.
The Wizard will convert most unity materials in a scene. You can view dynamic conversions separate from static lighting conversion. Some static lighting conversion require ‘spliting’ a material into a dynamic and static material in cases where an object marked as static uses material that is also used as a dynamic material elsewhere.
Daydream renderer doesn’t support using the same material on static and dynamic objects.
Once converted the wizard provides a ‘revert’ option allowing you to go back to the initial material setup.
Under the DaydreamRenderer/Examples folder there are two example scenes that show many of the Daydream Renderer features in action. These scenes can be found in the Daydream Renderer package under Examples/.
The DaydreamRendererDynamicLighting scene shows how to use dynamic normal mapped lights, lit transparencies, lit particles and dynamic shadow casting. Everything in the scene is lit by 8 dynamic lights and 5 of those lights can cast dynamic shadows. Note also that specular on the "metallic boxes" is attenuated by the alpha component of the albedo texture, adding extra richness to the shading.
The DaydreamRendererStaticLighting scene demonstrates static lighting using the Daydream Vertex Lighting allowing all surfaces to be affected by a large number of static, normal-mapped lights at almost no additional runtime cost with full specular support. All of the lights are mixed, so dynamic objects will still be affected - allowing for easier integration of static and dynamic lighting.
To use the lighting system you will need to apply one of the Daydream Renderer shaders to your materials. There are a variety of settings that you can adjust with different visual / performance tradeoffs.
Daydream/Standard shader covers most use cases, supporting diffuse and specular with normal maps or detail maps. If you are not sure which one to use, then use this one.
Daydream/Reflection shader supports cubemap based reflections.
Daydream/Diffuse shader is a simplified shader that may provide better performance if you do not need specular or reflections.
The Specular and Reflection Lightprobe options will expand if those are selected and those sections will be detailed later.
The following settings are available on the material in the Inspector view. Note that some of these settings are only available in specific shaders - those will be called out in parenthesis.
Texture
Albedo texture, RGB is the color and Alpha is used to mask specular or reflections if enabled. Tiling and Offset works the same as the standard Unity shader except that they also apply to the normal map.
Normal
The tangent space normal map, where (0, 0, 255) is pointing straight up.
Reflection Map (Daydream/Reflection)
Only shows up with the Reflection shader. Artists are responsible for specifying their own cubemaps when using reflections. Rendering and updating cubemaps at runtime incurs too much overhead for mobile VR.
Base Color
The RGB is multiplied with the Albedo and Alpha with the specular mask.
Emissive
A scalar value (between 0 to 1) that identifies how emissive the surface is, a value of 1.0 will cause the Base Color and Texture to show through without any lighting. The emissive is scaled with the Texture alpha channel, so masked emissive is possible.
Wrap
Allows the lighting to "wrap around" to simulate translucency. The default value of 0.0 produces normal “hard” lighting and the value of 1.0 produces very soft lighting that wraps around the object.
Baked Light Scale
This value scales the effect of static lighting, whether it's from Lightmaps or Vertex lighting. With a value of 0.0 static lighting has no visible effect and at 1.0 it has full effect. Values above 1.0 causes the static lighting to become “over-bright.” The static lighting example uses this feature to smoothly transition between static light states.
Smoothness
Specifies how smooth the surface is. In general smoother surfaces, closer to 1.0, will have sharp, bright specular highlights whereas rough surfaces, closer to 0.0, will have diffused highlights. 0.5 is a good default.
Shadow Intensity
Scales the intensity of dynamic shadows affecting this surface. A value of 0.0 will result in completely transparent shadows (i.e. they won’t be visible) and 1.0 will result in darker shadows. 1.0 is a good default.
Shadow Falloff
A measure of how quickly shadows will fade with distance from the occluder. At 0.0 the shadows will not fade at all and at 1.0 they will fade away immediately. 0.3 is a good default.
AO Diffuse
If Ambient Occlusion is enabled, this scales the effect it has on the Diffuse Lighting, where there is no visible AO at 0.0 and it has full effect at 1.0. The default is 1.0.
AO Specular
If Ambient Occlusion is enabled, this scales the effect it has on the Specular Lighting or Reflections, where there is no visible AO at 0.0 and it has full effect at 1.0. The default is 0.0.
Rendering Mode
This describes how the surface is rendered, for example Opaque surfaces are completely solid. Render Modes include Opaque, Cutout, Blend, Premultiply, Additive and Multiply.
Light Count
The number of dynamic lights enabled for this material. The options are 0, 4 or 8. The fragment shader cost for 4 or 8 lights is exactly the same but the vertex shader cost varies. Note that at least 4 dynamic lights must be enabled for the surface to be lit.
Particle Rendering
Optimize for particle rendering. Lit particles are automatically enabled if the Light Count (above) is greater than zero. Usually you want to use Blend, Premultiply or Additive Rendering mode (see above).
Clamp Attenuation
With the default Unity lighting model, light doesn’t reach zero before the light is culled. Usually that is fine but sometimes it causes artifacts. Use this setting in those cases - the lighting will fall-off to exactly zero but will appear a little dimmer than standard Unity lights.
Normal map
Use the normal map for diffuse and specular lighting. This will give you the best quality and is recommended.
Normal map - flip Y (green)
Some normal maps are encoded so that the green channel is flipped compared to what Unity expects, use this setting to handle that case.
Detail map
Use the second texture as a Detail map instead of a Normal map. In this case, the RGB of the second map is multiplied with the base color. Usually you will want to have different scale/offset settings for the second map in this case.
Specular
Enable the analytical specular approximation from all dynamic light sources (and static light sources once the static lighting system is integrated). This will open up several options which will be detailed later.
Reflection Lightprobe
Enable a cubemap based specular approximation instead of analytical specular. This will also open up options that will be detailed below.
Ambient Occlusion
Use the alpha channel of the normal map or detail map as Ambient Occlusion. This value is multiplied with the Diffuse and/or Specular lighting to simulate Ambient Occlusion. You will need to bake this value in another tool.
Shadow Receiver
This surface can receive dynamic shadows.
Dynamic Ambient
Use the dynamic, multi-color ambient in addition to normal lighting.
Enable Static Lighting
Enable static lighting for surfaces using the material. Note that the objects themselves must be static as well, otherwise dynamic lighting will be used instead.
Fixed Specular Power [LOW]
Enable this to use a low fixed specular power rather than computing it from the Smoothness. This should improve fragment shader performance slightly, so consider using this option if it matches the desired look. If enabled then Smoothness will only affect the intensity of the specular.
Fixed Specular Power [MED]
Enable this to use a medium fixed specular power rather than computing it from the Smoothness. This should improve fragment shader performance slightly, so consider using this option if it matches the desired look. If enabled then Smoothness will only affect the intensity of the specular.
Colored Specular
By default specular is monochromatic, enable this to use full colored specular at an increased fragment shader cost. Try toggling the option before deciding to use it, in most cases the visual difference is very small.
Specular Antialiasing
By default, specular causes a lot of aliasing along the polygon edges. If this is enabled, centroid sampling is used to avoid sampling outside of the triangles which greatly improves this issue. However there is some cost in performance and not all drivers handle centroid sampling properly, so it is optional.
Colored Specular
By default specular is monochromatic - which in the case of cubemaps means that only the green channel is used as intensity. Enable this to use full colored specular at an increased fragment shader cost. Try toggling the option before deciding to use it, in most cases the visual difference is very small. Note that the local lighting environment is used to tint the cubemap results, so often the c
暂无开放 Issues,或尚未同步最近议题。