OpenGL ES 和 Unity3D 邓伦和孙怡是什么关系系

扫一扫,访问微社区
后使用快捷导航没有帐号?
签到成功!您今天第{todayrank}个签到,签到排名竞争激烈,记得每天都来签到哦!已连续签到:{constant}天,累计签到:{days}天
当前位置: &
查看: 902|回复: 2
Unity3D官方翻译教程-特定平台的渲染差异 Platform Specific Rendering Differences(六)
85904/10000排名7昨日变化主题帖子积分
常驻蛮牛, 积分 5904, 距离下一级还需 4096 积分
常驻蛮牛, 积分 5904, 距离下一级还需 4096 积分
蛮牛币20501
在线时间502 小时
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
才可以下载或查看,没有帐号?
Platform Specific Rendering Differences& & 特定平台的渲染差异如有翻译不当之处,还请帮忙指出!
Unity runs on various platforms, and in some cases there are differences in how things behave. Most of the time Unity hides the differences from you, but sometimes you can still bump into them.Unity运行在不同平台上,并在某些情况下某些物体会出现不同的表现形式。在大部分时间Unity为你隐藏了这些差异,但有时侯你仍然可以撞到它们。 Render Texture Coordinates& && && && && && &渲染纹理坐标Vertical texture coordinate conventions differ between Direct3D, OpenGL and OpenGL ES:垂直纹理坐标在Direct3D, OpenGL和OpenGL ES之间有所不同:& && &In Direct3D, the coordinate is zero at the top, and increases downwards.& && &在Direct3D中,坐标在顶部为0,并向下增加。& && &In OpenGL and OpenGL ES, the coordiante is zero at the bottom, and increases upwards.& && &在OpenGL和OpenGL ES中,坐标在底部为0,并向上增加。Most of the time this does not really matter, except when rendering into aRenderTexture. In that case, Unity internally flips rendering upside down when rendering into a texture on Direct3D, so that the conventions match between the platforms.这大部分的时间内其实并不重要,除非我们需要渲染一张RenderTexture。在这种情况下,当需要在Direct3D中渲染一张纹理时,Unity会自上而下地翻转渲染次序,从而使纹理坐标可以在各项平台之间进行匹配。One case where this does not happen, is whenImage Effects and Anti-Aliasing is used. In this case, Unity renders to screen to get anti-aliasing, and then &resolves& rendering into a RenderTexture for further processing with an Image Effect. The resulting source texture for an image effect isnot flipped upside down on Direct3D (unlike all other Render Textures).在使用图像特效和反走样时将不会出现上述情况。Unity渲染到屏幕并获得反走样效果,然后&解析&渲染到 RenderTexture并通过图像特效来进行进一步的处理。针对一种图像特效来生成的源纹理在Direct3D上并不需要颠倒翻转(不同于所有其他渲染的纹理)。If your Image Effect is a simple one (processes one texture at a time), this does not really matter, becauseGraphics.Blit takes care of that.如果你的图像后处理特效是的一个简单的操作(一次处理一个纹理),那么渲染坐标纹理的次序其实并不重要,因为 Graphics.Blit会来进行管理。However, if you're processing more than one RenderTexture together in your Image Effect, most likely they will come out at different vertical orientations (only in Direct3D, and only when anti-aliasing is used). You need to manually &flip& the screen texture upside down in your vertex shader, like this:但是,如果你在图像特效中同时处理多个RenderTexture,最有可能它们的纹理坐标拥有不同的垂直方向(只在 Direct3D,和只在使用反走样效果时会出现这种情况)。这时,你需要在你的顶点着色器中手动&翻转&屏幕纹理,像这样:[AppleScript] 纯文本查看 复制代码&span style=&font-size:12&&// On D3D when AA is used, the main texture & scene depth texture
// will come out in different vertical orientations.
// So flip sampling of the texture when that is the case (main texture
// texel size will have negative Y).
#if SHADER_API_D3D9
if (_MainTex_TexelSize.y & 0)
uv.y = 1-uv.y;
#endif&/span&
Check out Edge Detection scene inShader Replacement sample project for an example of this. Edge detection there uses both screen texture and Camera'sDepth+Normals texture.对于这种例子,可以查看着色器变更项目中的边检测场景。边检测特效既使用屏幕纹理,又使用的深度+法线纹理。 Using OpenGL Shading Language (GLSL) shaders with OpenGL ES 2.0& && &&&在OpenGL ES 2.0中使用GLSL编写的着色器OpenGL ES 2.0 provides only limited native support for OpenGL Shading Language (GLSL), for instance OpenGL ES 2.0 layer provides no built-in parameters to the shader.OpenGL ES 2.0仅本地支持OpenGL着色语言 (GLSL),例如 OpenGL ES 2.0 层为着色器没有提供内置参数。Unity implements built-in parameters for you exactly in the same way as OpenGL does, however following built-in parameters are missing:Unity完全以OpenGL相同的方式为你实现内置参数,但是以下的内置参数将会缺失:& && &gl_ClipVertex& && &gl_SecondaryColor& && &gl_DepthRange& && &halfVector property of thegl_LightSourceParameters structure& && &gl_FrontFacing& && &gl_FrontLightModelProduct& && &gl_BackLightModelProduct& && &gl_BackMaterial& && &gl_Point& && &gl_PointSize& && &gl_ClipPlane& && &gl_EyePlaneR,gl_EyePlaneS,gl_EyePlaneT, gl_EyePlaneQ& && &gl_ObjectPlaneR,gl_ObjectPlaneS,gl_ObjectPlaneT, gl_ObjectPlaneQ& && &gl_Fog
iPad2 and MSAA and alpha-blended geometry& && && && & iPad2、MSAA和alpha混合几何There is a bug in apple driver resulting in artifacts when MSAA is enabled and alpha-blended geometry is drawn with non RGBA colorMask. To prevent artifacts we force RGBA colorMask when this configuration is encountered, though it will render built-in Glow FX unusable (as it needs DST_ALPHA for intensity value). Also, please update your shaders if you wrote them yourself (see &Render Setup -& ColorMask& inPass Docs).在苹果驱动程序中,当启用MSAA,并使用非RGBA colorMask进行alpha混合几何渲染时,会出现一个bug。为了防止发生这种bug,我们在遇到此种配置时强制使用RGBA colorMask,但这样做的后果会使内置Glow FX无法使用(因为它用到了DST_ALPHA所需要的强度值)。另外,如果是你自己写的着色器,请一定不要忘记更新它们(请参阅Pass Docs中的& Render Setup -& ColorMask&文档)。
游客,如果您要查看本帖隐藏内容请
unity opengl es 3;unity官方文档unity 5unity opengl es 3.0;unity colormask 0;opengl es 3.0 unity3d;unity shader官方文档;unity shader glow
每日推荐:
最近百度对文件链接审查比较严格,如果遇到链接失效情况,可以加QQ补蛮牛币
71697/5000排名<font color="#FF昨日变化主题帖子积分
日久生情, 积分 1697, 距离下一级还需 3303 积分
日久生情, 积分 1697, 距离下一级还需 3303 积分
蛮牛币3944
在线时间259 小时
学习中。。。
每日推荐:
119/50排名<font color="#FF昨日变化77主题帖子积分
注册看看, 积分 19, 距离下一级还需 31 积分
注册看看, 积分 19, 距离下一级还需 31 积分
在线时间3 小时
发表于 5&天前
感谢分享~~~~
每日推荐:
连续签到30天
原创精华达人
原创精华帖子总数量 ≥ 100
论坛建议之星
为论坛提出建设性的建议并被多数被采纳,必须采纳5条以上
突出贡献奖
宣传论坛,介绍更多的朋友加入≥50人
累积数量达到100000蛮牛币
游戏蛮牛QQ群会员
加入游戏蛮牛官方QQ群
在“新人报到 ”版块发过自己的照片
社区QQ达人
使用QQ帐号登录论坛的用户

我要回帖

更多关于 吴秀波汤唯是什么关系 的文章

 

随机推荐