存档在 2011年1月

新渲染器OpenGL Core Profile模式基础物终于完成

2011年1月30日

同上篇的三角形一样,虽然只是2个普通的方块,但它们确需要很高端的显卡。全OpenGL 3.3/4.1 Core Profile编程,文末附Shader.


vertex_shader:

#version 330

uniform mat4 projection_matrix;
uniform mat4 modelview_matrix;

in vec3 Vertex;
in vec3 Normal;

out vec3 fragment_normal;

void main(void)
{
fragment_normal=(modelview_matrix*vec4(Normal,0.0)).xyz;

gl_Position=projection_matrix*modelview_matrix*vec4(Vertex,1.0);
}

fragment_shader:

#version 330

in vec3 fragment_normal;

uniform vec4 color;

layout(location = 0, index = 0) out vec4 fragColor;

void main(void)
{
float intensity=max(dot(fragment_normal,vec3(0.0,0.0,1.0)),0.0);

fragColor=color*intensity;
}

一个需要Radeon HD5/GeForce GTX4显卡的纯色三角形

2011年1月27日

虽然这个程序只是简单的画了一个纯红色的三角形,但是这个程序的硬件需求却不低。AMD Radeon系列显卡最低需要HD5xxx系列,而NVIDIA  GeForce系列显卡也是最低需要GTX 4xx系列。

这一切都要源于它使用OpenGL 4.0 核心向前兼容模式绘制,GL_VERSION字串输出为“4.0.10317 Core Profile Forward-Compatible”。

《古月》旧渲染引擎版本继续,新渲染引擎用于下一代

2011年1月18日

看到这一则声明,可能很多朋友有朝令夕改的感觉。刚説的旧版不再继续,结果现在又宣布要继续了。

其实本质上还是差不多的,因为新的渲染器影响到的内容太多,会导致整个引擎大部分重制。这样相比下载,还不如直接重构制作下一代。

所以我们决定继续旧渲染器的《古月》v18版本,下一代的《古月》v19才会用上全新的渲染器。

新3D渲染器今日进度(WIP):树形节点展开渲染完成

2011年1月15日

这个回旋形排列的立方体列表见多了,这次使用了场景节点方式,把所有的立方体放入了一个根节点,然后我们旋转了这个根节点。

Ogg、Vorbis、Theora插件例行更新

2011年1月14日

下载请点击这里(.RAR格式,276KB)

更新LibOgg到1.2.2、更新LibVorbis到1.3.2

libvorbis 1.3.2 (2010-11-01) — “Xiph.Org libVorbis I 20101101 (Schaufenugget)”

  • vorbis: additional proofing against invalid/malicious streams in floor, residue, and bos/eos packet trimming code (see SVN for details).
  • vorbis: Added programming documentation tree for the low-level calls
  • vorbisfile: Correct handling of serial numbers array element [0] on non-seekable streams
  • vorbisenc: Back out an [old] AoTuV HF weighting that was first enabled in 1.3.0; there are a few samples where I really don’t like the effect it causes.
  • vorbis: return correct timestamp for granule positions with high bit set.
  • vorbisfile: the [undocumented] half-rate decode api made no attempt to keep the pcm offset tracking consistent in seeks. Fix and add a testing mode to seeking_example.c to torture test seeking in halfrate mode.  Also remove requirement that halfrate mode only work with seekable files.
  • vorbisfile:  Fix a chaining bug in raw_seeks where seeking out of the current link would fail due to not reinitializing the decode machinery.
  • vorbisfile: improve seeking strategy. Reduces the necessary number of seek callbacks in an open or seek operation by well over 2/3.

新3D渲染器今日进度(WIP):贴图显示、高度图显示

2011年1月10日

示例程序点击这里下载(2108k,rar格式)

加上法线的高度图

未上法线的高度图

新3D渲染器今日进度(WIP),像机控制漫游完成

2011年1月7日

在最新的版本中完成了像机控制,下面这个例子的截图有一部分朋友可能在一年前的渲染器中见过,那一版失败了。虽然这一版从效果上看和旧版并无区别,但在处理上却有着本质上的差别。

旧版的像机控制使用 gluLookAt函数实现,所有的矩阵变换也全部依赖OpenGL API。而在这一版中,所有的全局变换矩阵运算完全在CPU完成。

示例程序点击这里下载(339k,rar格式)

《古月》R48将不提供C++Builder版本

2011年1月6日

这是《古月》引擎自1998年创建以来,首次不再发布Borland C++/C++Builder版。

不再发布并不是因为新版本不再支持C++Builder。而是因为Embarcadero公司拒绝向中国大陆地区的个人提供C++Builder授权,我方在尝试向美国Embarcadero直接购买C++Builder授权无果后,决定暂时停止发布《古月》的C++Builder版本。

旧绘图模式最终版:《古月》R48即将发布

2011年1月6日

源于新渲染器的开发,新的绘图模式更加直观,能够充分发挥出新硬件的效能。然后,这种新的渲染模式与旧的绘图代码存在冲突,无法并存。

所以,我们将在此发布基于旧渲染的最新版也是最终版《古月》引擎。第48个版本,从2003年末至今,历时7年,超过20款软件使用。

基于新渲染器的《古月》引擎将不再支持直接访问OpenGL API,同时大量的OpenGL 直接功能映射模块将会被删除。所有的绘制操作均会抽像化与直观化,支持多种级别的图形API。

新3D渲染器今日进度(WIP),接管所有矩阵计算

2011年1月6日

《古月》新的3D渲染器将会提供固定管线与可编程管线两种版本,其中固定管线模式使用OpenGL兼容模式、可编程管线使用OpenGL核心模式。为了在最大程度将双版本的处理统一,我方使用了类似可编程管线中的手法:不再使用OpenGL/GLU所提供的矩阵管理与变换函数,固定管线仅在最后一刻设置GL_PROJECTION与GL_MODELVIEW矩阵并渲染。其中被接管的函数包括:gluPerspective、glOrtho/gluOrtho、glFrustum、gluLookAt、glPushMatrix、glPopMatrix等等。

见如下一段代码:
bool OpenGLCompatibilityRender::DirectRender(const glm::mat4 &ltw,Renderable *obj)
{
if(!obj)return(false);

ClearMatrix(GL_PROJECTION);
glLoadMatrixf(glm::value_ptr(projection_matrix));

ClearMatrix(GL_MODELVIEW);
glLoadMatrixf(glm::value_ptr(modelview_matrix*ltw));

/*//可以不设置PROJECTION,只在MODELVIEW里设置用以下方式
//ClearMatrix(GL_PROJECTION);
//ClearMatrix(GL_MODELVIEW);
//glLoadMatrixf(p);
//glMultMatrixf(m*ltw);
*/

bool result=DirectRender(obj);

ClearMatrix(GL_PROJECTION);
ClearMatrix(GL_MODELVIEW);

return(result);
}

鄂ICP备09027626号