zoukankan      html  css  js  c++  java
  • Axiom3D学习日记 0.Axiom基础知识

    Axiom 3D Engine

    An open-source, cross-platform, managed 3D rendering engine for DirectX, XNA and OpenGL running on .Net and Mono

    开源,跨平台,支持多种渲染方法的3D引擎,可以运行于.Net和Mono平台,支持Dx3d,XNA,OpenGL

    Orge3D的.Net版,我没有看过他的源码,但貌似就是用C#写的Orge.

    Texture:

    Basic, Multi-texturing, Bumpmapping, Mipmapping, Volumetric, Projected:

    • Support for a variety of image formats, including .png, .jpg, .gif, .tga, with dynamic MipMap generation. .dds files are supported for 2D, Volume, and Cubic textures in both DirextX AND OpenGL via DevIL.
    • 1D, 2D, Cubic, and Volume textures.

    Shader:

    Vertex, Pixel, High Level:

    • Vertex/Fragment programs, including Cg and HLSL high level plugins, as well as support for loading ASM shaders
    • Vertex/Fragment programs are also fully configurable in the material files, and allow for parameters that instruct the engine to track various states and supply them automatically to the program parameters, such as worldviewproj_matrix, light_position_object_space, camera_position_object_space, etc.
    • Support profiles at present are: * DirectX 8 - vp_1_1, ps_1_1 - ps_1_4 * DirectX 9 - vp_2_0, ps_2_0 * OpenGL - arbvp1, arbfp1, fp20 (GeForce3/4 Register and Texture Combiners supported via nvparse), vp30/fp30 (GeForceFX).

    Scene_Management

    General, BSP, Octrees, LOD:

    • Extensible Hierarchical Scene Graph
    • Octree scene manager plugin which includes a basic heightmap loading scene manager

    Animation:

    Keyframe Animation, Skeletal Animation:

    • Skeletal animation with an Ogre .skeleton file loader. Features include multiple bone assignments per vertex, smooth frame rate scaled blending, and multiple animations can be blended together to allow for seamless animation transitions.
    • Pose animation allowing for facial animations and more.
    • Allows animations to be assigned to nodes in the scene graph, allowing objects to move along predefined spline paths.

    Mesh:

    Mesh Loading, Skinning, Progressive:

    • Fast Mesh loader support the Ogre .mesh file formats 1.10 and 1.20, now including pre generated LOD levels based on the entitie's distance from the camera.
    • Exporters for various 3D Modeling programs, including Milkshape and 3dx Max can be downloaded from the Ogre downloads page

    Special Effect:

    Environment Mapping, Billboarding, Particle System, Sky, Fog, Mirror:

    • Spherical environment mapping
    • Particle systems, extendable via plugins for defining new Emitters and Affectors and definable through Ogre particle scripts.
    • Support for skyboxes via cubic textures, and sky planes.
    • 2d billboard support, with built in pooling to reduce runtime overhead. Supports sprites, and is also used for the particle system.
    • Post-process compositor effects for HDR, Bloom, Motion Blur etc.

    Rendering:

    Fixed-function, Render-to-Texture, Fonts, GUI:

    • Extensible render system support, via plugins. Current implementations include Tao for OpenGL, and Managed DirectX 9, Xna is under development.
    • Virtual hardware vertex/index buffer interface, allowing for faster rendering of primitives by placing geometry data in video AGP memory, eliminating the need for keeping it in application memory and copying it over every frame.
    • Support for Ogre .material files, allowing the flexibility for controlling fixed function render state on a per object basis, in addition to specifying texture blending and texture effects such as scrolling and rotating.
    • Smart rendering pipeline, with sorting designed to reduce render state changes as much as possible. Transparent objects are also sorted to allow blending into the scene correctly.
    • Font bitmap support using the Ogre .fontdef format for loading bitmaps based and dynamically generated font bitmaps.

    程序基本步骤:

    1. Create the Root object.
    2. Define the resources that the application will use.
    3. Choose and set up the render system (that is, DirectX, OpenGL, etc).
    4. Create the render window (the window which Axiom will render onto).
    5. Initialize the resources that you are going to use.
    6. Create a scene using those resources.
    7. Set up any third party libraries and plugins.
    8. Create frame listeners.
    9. Start the render loop.

    定义资源

     资源包括 textures, models, scripts, 等等. . Thus far we have been using EngineConfig.xml to define Resource paths.
    通过 ResourceGroupManager class 来新增资源路径:

    1.ResourceGroupManager.Instance.AddResourceLocation(location, type, group);

    第一个参数是 文件夹名字.

    第二参数是资源类型: "Folder" (文件夹) or "Zip" (压缩包).

    第三参数,资源组.

    1.ResourceGroupManager.Instance.AddResourceLocation("Media", "Folder", "General");

    选择渲染系统

     
    1.root.RenderSystem = root.RenderSystems["DirectX9"];

    选项有 DirectX9, OpenGL, and Xna.

    1.Root.Instance.RenderSystem.ConfigOptions["Video Mode"].Value = "1280 x 720 @ 32-bit color";

    这里有些共有设定:

    Name
    Purpose
    Video Mode
    Sets resolution and color-depth.颜色深度
    Full Screen
    Sets whether to use the full screen.是否全屏
    VSync
    Syncs FPS to monitors refresh rate,垂直同步
    Anti-Aliasing
    Gives the appearence of smoother edges.抗锯齿
    Floating-Point mode
    浮点模式,平滑或则快速

    创建一个渲染窗口.

    1.RenderWindow window = root.Initialize(true, "Window Title");

    第一个参数:是否创建窗口.如果true,就会创建.

    1.RenderWindow window = root.CreateRenderWindow("Axiom Render Window", 800, 600, false);
    不创建窗口,而用winform窗口,就用下面的代码.
    Axiom.Collections.NamedParameterList paramList = new Axiom.Collections.NamedParameterList();
    paramList["externalWindowHandle"] = pictureBox1.Handle;
    Axiom.Graphics.RenderWindow window = _Root.CreateRenderWindow("RenderWindow", pictureBox1.Width, pictureBox1.Height, false, paramList);

  • 相关阅读:
    TCP/IP笔记 一.综述
    Makefile的规则
    u盘安装ubuntu10.04 server.txt
    浅谈数据库技术,磁盘冗余阵列,IP分配,ECC内存,ADO,DAO,JDBC
    cocos2d-js 热更新具体解释(一)
    C#一个托付的样例
    JAVA学习之 异常处理机制
    阿里巴巴校招内推简历筛选方案
    《凑硬币》 动态规划算法入门
    android 读取xml
  • 原文地址:https://www.cnblogs.com/niconico/p/5007720.html
Copyright © 2011-2022 走看看