- 浏览: 257025 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
15665280578:
[color=red][/color]加executeUpda ...
HQL如何执行update,delete相关的createQuery -
thy_mm:
多谢。
如何取消SVN管理 -
zhys1314:
[url][url][url][url][url][url][ ...
HQL如何执行update,delete相关的createQuery -
demojava:
大哥,你代码不全啊,无法运行啊。。
Away3D Lite:Basic_InteractiveObject -
demojava:
我做了一个demo,发现和你的不一样。
你可以看一下:
htt ...
Away3D Lite:Basic_SceneSetup
Away3D中的光照可以分为三个基本要素:
- the light source(s) defining the properties of the light(s)
- light source(s) 定义了光照的属性
- shaders providing algorithms that determine how a light source interacts with a material
- shaders 提供一些决定光源如何同材质交互的算法
- a material type combining different shaders along with base colours or bitmaps
-
一种组合
了不同 shaders 和 colors 或者 bitmaps 的 material type
第一个同PV3D不同之处是我们可以指定超过一个光源 。这样会加大CPU的负担,但同时也可以制造出更加真实的场景渲染。
三种主要的 light sources:
- AmbientLight3D which has no position and provides a uniform ambient light to all objects
-
AmbientLight3D
(环境光源
)没有空间坐标,他为所有的 object 提供了一种统一的环境光照
- DirectionalLight3D which provides light from a specified position but with a strength that does not diminish with distance
- DirectionalLight3D (定向光源 ),有一个空间坐标,有一个不会减弱的光照强度
- PointLight3D providing light from a specified position that weakens in intensity with distance
- PointLight3D (点光源 ),有一个空间坐标,光照强度会随着距离的增加而减弱
以下几种 shaders:
- AmbientShader which provides ambient shading to a triangle face
- AmbientShader 为一个三角面提供环境阴影
- DiffusePhongShader which, depending on the angle between the light source and a triangle face, produces a diffuse shading pattern
- DiffusePhongShader 根据光源和三角面之间所成的角度,产生一个散射阴影
- SpecularPhongShader which produces specular shading on triangles to imitate a surface that is reflecting light, depending on the observer’s position and the light position
-
SpecularPhongShader
根据观察者和光源的位置,为三角面产生一个模拟的反射光源的效果
- EnviroShader allowing for environment mapping, producing a reflection from a surrounding environment on an object, independent of a light source. Requires bitmap data for the environment
-
EnviroShader
根据光源位置和环境贴图,给 object 添加一个环境贴图反射的映射
- DiffuseDot3Shader to increase scene reality by adding more small scale structure through the use of normal mapping to an object. Requires bitmap data for the normal map
- DiffuseDot3Shader 通过增加更多的 structure 来增加场景的真实感
以上shaders,除了 EnviroShader ,其余的 light source 都是DirectionalLight3D
我们可以选择使用CompositeMaterials ,这种材质包含了一些不同的 shaders 和基于这些 shaders 的materials。
material列表如下:
PhongBitmapMaterial used to create ambient, diffuse and specular lighting on a texture-mapped material
Base material : BitmapMaterial
Shaders : AmbientShader , DiffusePhongShader and SpecularPhongShader
PhongMovieMaterial used to create ambient, diffuse and specular lighting on a material based on another Flash movie
Base material : MovieMaterial
Shaders : AmbientShader , DiffusePhongShader and SpecularPhongShader
PhongColorMaterial used to create ambient, diffuse and specular lighting on a simple coloured material
Base material : ColorMaterial
Shaders : AmbientShader , DiffusePhongShader and SpecularPhongShader
EnviroBitmapMaterial used to create environmental lighting on a texture-mapped material
Base material : BitmapMaterial
Shaders : EnviroShader
Dot3BitmapMaterial used to create ambient and normal-mapped lighting on a texture-mapped material
Base material : BitmapMaterial
Shaders : AmbientShader and DiffuseDot3Shader ,
Dot3MovieMaterial used to create ambient and normal-mapped lighting on a material based on another Flash movie
Base material : MovieMaterial
Shaders : AmbientShader and DiffuseDot3Shader
以上这些 materials 都是很耗性能的 ,如果你想使用简单点的 shade ,你可以选择CenterLightingMaterial 这种材质的效果就相同于PV3D里的 flat-shaded materials ,Away3D里有两种选择 :
- ShadingColorMaterial for simple flat shading of a ColorMaterial
- WhiteShadingBitmapMaterial for simple flat shading of a BitmapMaterial , but assuming that the light source is always white (independent of colour given to light source).
// create a new directional white light source with specific ambient, diffuse and specular parameters var light:DirectionalLight3D = new DirectionalLight3D({color:0xFFFFFF, ambient:0.25, diffuse:0.75, specular:0.9}); light.x = 100; light.z = 500; light.y = 500; scene.addChild(light); // Create an object container to group the objects on the scene group = new ObjectContainer3D(); scene.addChild(group); // Create a new sphere object using a very shiny phong-shaded bitmap material representing the earth var earthMaterial:PhongBitmapMaterial = new PhongBitmapMaterial(Cast.bitmap(earthBitmap)); earthMaterial.shininess = 100; sphere = new Sphere({material:earthMaterial, radius:50, segmentsW:10, segmentsH:10}); sphere.x = ORBITAL_RADIUS; sphere.ownCanvas = true; group.addChild(sphere); // Create a new cube object using a tiled, phong-shaded bitmap material var tiledAway3DMaterial:PhongBitmapMaterial = new PhongBitmapMaterial(Cast.bitmap(away3DBitmap), {repeat:true, scaleX:.5, scaleY:.5}); cube = new Cube({material:tiledAway3DMaterial, width:75, height:75, depth:75}); cube.z = -ORBITAL_RADIUS; cube.ownCanvas = true; group.addChild(cube); // Create a cylinder mapping the earth data again cylinder = new Cylinder({material:earthMaterial, radius:25, height:100, segmentsW:16}); cylinder.x = -ORBITAL_RADIUS; cylinder.ownCanvas = true; group.addChild(cylinder); // Create a torus object and use a checkered, flat-shaded (from white light) bitmap material var checkerBitmapMaterial:WhiteShadingBitmapMaterial = new WhiteShadingBitmapMaterial(Cast.bitmap(checkerBitmap)); torus = new Torus({material:checkerBitmapMaterial, radius:40, tube:10, segmentsT:8, segmentsR:16}); torus.z = ORBITAL_RADIUS; torus.ownCanvas = true; group.addChild(torus); // Create a new cube object using a smoothed, precise, phong-shaded, mat (not shiny) bitmap material var away3DMaterial:PhongBitmapMaterial = new PhongBitmapMaterial(Cast.bitmap(away3DBitmap), {smooth:true, precision:2}); away3DMaterial.shininess = 0; centerCube = new Cube({material:away3DMaterial, width:75, height:75, depth:75}); centerCube.ownCanvas = true; group.addChild(centerCube); // add mouse listeners to all the 3D objects sphere.addOnMouseDown(onMouseDownOnObject); cube.addOnMouseDown(onMouseDownOnObject); cylinder.addOnMouseDown(onMouseDownOnObject); torus.addOnMouseDown(onMouseDownOnObject); centerCube.addOnMouseDown(onMouseDownOnObject);
sphere.ownCanvas = true;
这句话很重要,没有这句话,当 objects 被别的 objects 遮挡了 ,他们可能不会被正确渲染
发表评论
-
Away3D(八):Texture mapping
2009-12-04 16:09 1142BitmapMaterial :用于简单texture ma ... -
Away3D(七):Primitives(Part 3)
2009-12-04 14:58 1602The Cone:(圆锥) // creat ... -
Flash3D 编程技巧:全景浏览的键盘交互(Away3D)
2009-12-04 14:12 1661创建三个侦听: this.stage.add ... -
Away3D(六):Primitives(Part 2)
2009-12-04 14:07 1187The Trident:(坐标轴) ... -
Away3D(五):Primitives(Part 1)
2009-12-01 17:03 1312The Triangle: var tri: ... -
Away3D(四):Create the Earth and heavens in less than an hour with Away3D
2009-12-01 16:18 1490原文:http://www.flashmagazine.com ... -
Flash3D编程技巧:物体环视浏览器(Away3D)
2009-11-30 19:59 2215定义一些以后会用到的 ... -
Away3D(三):Manipulating 3D objects
2009-11-30 19:55 1159Movement in 3D space: ... -
Away3D(二):The View and the Scene
2009-11-30 19:49 1148The View: var view:View3 ... -
Away3D(一):The Camera(s)
2009-11-30 19:44 1399原理图: Away3D Cameras: ... -
Flash3D 编程技巧:全景浏览的鼠标交互(Away3D Lite)
2009-11-26 14:20 20871. 注册侦听器 addEventListe ... -
Away3D Lite:Flex Project 使用模板
2009-11-26 09:57 17801. 3D as实现类,同ActionScript Proje ... -
Away3D Lite:Others
2009-11-24 19:42 2102使用TargetCamera: // 将ca ... -
Away3D Lite:ExMD2Cubic
2009-11-24 19:28 1144加载MD2模型文件: // 位图文件材质 ... -
Away3D Lite:ExCollada
2009-11-24 15:26 1118采用FastTemplate模板: 默认st ... -
Away3D Lite:Basic_LoadModel
2009-11-24 13:57 2089开启Debug模式:具体什么作用,尚不知 / ... -
Away3D Lite:Basic_InteractiveObject
2009-11-22 20:29 1897初始化引擎: sce ... -
Away3D Lite:Basic_SceneSetup
2009-11-20 16:35 1496scene = new Scene3D(); // 亦可 ...
相关推荐
图形管线与OpenGL II:光照与着色,片段处理 图形管线是计算机图形学中渲染图像的关键步骤,它将三维场景转换成二维图像。在图形管线的多个阶段中,光照与着色是实现图像真实感最重要的环节之一。...
2. **Phong Shading**:不仅在顶点处计算颜色,还会在多边形内部的每个像素点上计算光照,这种方法可以产生更细腻的高光效果。 3. **纹理映射**:使用预先定义的图像来模拟物体表面的细节,增加图像的真实感。 ####...
3. **材质和着色器系统**:Away3D 4.6.0可能改进了材质和自定义着色器的处理方式,使开发者能创建更多样化的3D物体表面效果。源码中会包含关于如何编写和应用GLSL(OpenGL Shading Language)着色器的示例。 4. **...
它提供了详细的理论与实践相结合的光线交互模型,为创建逼真的3D图像提供了解决方案。在PBRT中,Donner & Jensen的“一种用于人皮肤着色的频谱BSSRDF”是一种关键的技术,用于模拟人类皮肤的复杂光学特性。本文将...
Flat Kit Toon Shading and Water 2.1.3 最新版本
Unity Certified 3D Artist认证适合对美术设计感兴趣的人员,Unity Certified Programmer则针对编程人员,Unity Certified Expert分为Gameplay Programmer、Technical Artist: Rigging & Animation以及Technical ...
Unity3D 是一款广泛应用于游戏开发、虚拟现实和增强现实领域的3D引擎,它提供了丰富的功能,其中着色器(Shader)是实现复杂视觉效果的关键工具。本教程将介绍Unity3D中的着色器基础,重点讲解散射、凹凸和高光等...
示例代码 大卫·沃尔夫(David Wolff)出版并由Packt Publishing发行的的示例代码。 要求 要编译这些示例,您将需要以下内容: 0.9.6或更高版本。 请注意,0.9.6之前的版本可能无法正常使用,因为从度数转换为弧度...
图形学实验:flat shading C++源码(用opengl实现) 给定物体的动态序列(见附件),请利用局部光照模型将其渲染。要求: (1)给场景增加一个平坦的地面模型,增加纹理到地面上更好; (2)在适当位置设置两个光源; ...
Cel Shading,又称为卡通渲染或细胞着色,是一种在3D图形中模拟2D卡通风格的技术。它通过减少光照和阴影的连续性,使物体表面呈现出明显的边缘轮廓和单一的区域颜色,从而创造出类似漫画或动画的视觉效果。在游戏...
延迟光照(Deferred Shading)是一种在3D图形渲染中广泛使用的高级光照技术,它与传统的立即模式光照(Forward Shading)方法有所不同。延迟光照的主要目标是优化处理大量光源时的性能,尤其在复杂的场景中,当物体...
延迟着色(Deferred Shading)是一种在3D图形渲染领域广泛应用的技术,特别是在现代游戏和高级图形应用程序中。这种技术由Shawn Hargreaves等人提出并广泛推广,它改变了传统即时着色(Forward Shading)的方式,...
"Shape from Shading"(SFS)是一种计算机视觉技术,用于通过分析图像的像素颜色变化来重建三维物体的形状。在MATLAB环境中实现这一技术,我们可以利用其强大的图像处理和数学计算功能。以下是对"shape from shading...
OpenGL is the leading cross-platform 3D-graphics API, and the OpenGL Shading Language allows developers to take total control over the most important stages of the graphics-processing pipeline.
在IT行业中,尤其是在计算机视觉和图像处理领域,暗电流(Dark Current)和镜头遮光(Lens Shading),是两个非常重要的概念。它们直接影响到相机模组的成像质量和图像处理的效果。OpenCV是一个广泛使用的开源计算机...
apple公司的lens shading专利,用于iphone手机上使用。
xAxis3D: {type: 'category', data: ['Category 1', 'Category 2', ...]}, yAxis3D: {type: 'value'}, zAxis3D: {type: 'value'}, series: [{ type: 'bar3D', data: [[1, 2, 3], [2, 3, 4], ...], shading: '...
8. **光照和着色(Lighting and Shading)**:3D物体的外观受光照影响,包括光源类型(点光源、平行光等)、光照模型(Lambert、Phong等)以及阴影的计算。着色模型则决定了颜色如何随角度变化。 9. **纹理贴图...
标题与描述中的关键词“Abstract_Isophote_Distance_A_Shading_Approach_to_Artistic_Stroke_Thickness”指的是一种在计算机生成的平滑表面插图中确定笔触厚度的方法。文章由Todd Goodwin、Ian Vollick和Aaron ...