com.jme3.renderer.Renderer.renderMesh()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中com.jme3.renderer.Renderer.renderMesh方法的一些代码示例,展示了Renderer.renderMesh的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Renderer.renderMesh方法的具体详情如下:
包路径:com.jme3.renderer.Renderer
类名称:Renderer
方法名:renderMesh

Renderer.renderMesh介绍

[英]Renders count meshes, with the geometry data supplied. The shader which is currently set with setShader is responsible for transforming the input verticies into clip space and shading it based on the given vertex attributes. The int variable gl_InstanceID can be used to access the current instance of the mesh being rendered inside the vertex shader.
[中]使用提供的几何体数据渲染count网格。当前设置为setShader的着色器负责将输入垂直变换为剪辑空间,并基于给定的顶点属性对其进行着色。int变量gl_InstanceID可用于访问顶点着色器内正在渲染的网格的当前实例。

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

public static void renderMeshFromGeometry(Renderer renderer, Geometry geom) {
  Mesh mesh = geom.getMesh();
  int lodLevel = geom.getLodLevel();
  if (geom instanceof InstancedGeometry) {
    InstancedGeometry instGeom = (InstancedGeometry) geom;
    renderer.renderMesh(mesh, lodLevel, instGeom.getActualNumInstances(),
        instGeom.getAllInstanceData());
  } else {
    renderer.renderMesh(mesh, lodLevel, 1, null);
  }
}

代码示例来源:origin: org.jmonkeyengine/jme3-core

public static void renderMeshFromGeometry(Renderer renderer, Geometry geom) {
  Mesh mesh = geom.getMesh();
  int lodLevel = geom.getLodLevel();
  if (geom instanceof InstancedGeometry) {
    InstancedGeometry instGeom = (InstancedGeometry) geom;
    renderer.renderMesh(mesh, lodLevel, instGeom.getActualNumInstances(),
        instGeom.getAllInstanceData());
  } else {
    renderer.renderMesh(mesh, lodLevel, 1, null);
  }
}

代码示例来源:origin: info.projectkyoto/mms-engine

r.renderMesh(g.getMesh(), g.getLodLevel(), 1);
lightPos.setValue(VarType.Vector4, nullDirLight);
r.setShader(shader);
r.renderMesh(g.getMesh(), g.getLodLevel(), 1);

代码示例来源:origin: info.projectkyoto/mms-engine

r.renderMesh(geom.getMesh(), geom.getLodLevel(), 1);

相关文章