我想通过使用glBegin和不是GLSL,VBO和VAO以及所有这些来了解我的游戏会受到多大影响.他们只是看起来如此困难和荒谬,以实现我能做的更容易.我的选择会产生什么影响?
我在opengl中编写了一个新的代码库,并且很早就遇到了一个奇怪的错误.帧率的明显波动是重复和可预测的.
我知道它与呈现的对象完全成比例.它也与屏幕大小成正比(不是视口大小,不是窗口大小,只是物理设备大小)它大致是0.2:1(低:高)帧的比例
我很好奇并将其绘制成图形,请记住窗口/上下文没有被暗示或上限.

视图完全静止,所有物体都是静止的.每个帧都完全相同.任何时候都没有给出任何意见.没有什么是基于时间的.没有垃圾收集发生.
我不明白,如果它基本上是一个帧被反复渲染可能导致如此巨大的变化?
这是程序流的伪代码
create window
load shaders
grab uniform locations
create camera
create 3 meshes // They just hold the buffers and data for a model
create x objects and pass a pointer to a random mesh // Objects hold position, rotation etc + link to mesh
while game is running
poll window for events
capture mouse and recalculate VP matrix if required
for each object
recalc MVP
bind mesh's buffers and draw elements
draw window //SFML …Run Code Online (Sandbox Code Playgroud) 所以我阅读了OpenGL信息页面,textureGrad但它并没有真正解释任何内容.因此,您可以明确指定P相对于X和Y的偏导数
我的思绪已被吹嘘.
我想知道为什么无法比较相等的点并使用'=='显示为相等
例如
var p1:Point = new Point( 1, 5 );
var p2:Point = new Point( 1, 5 );
trace( p1 == p2 ) //false
trace( p1.x == p2.x, p1.y == p2.y ) //true true
trace( p1.equals( p2 )) //true
Run Code Online (Sandbox Code Playgroud)
这看起来很奇怪而且有点无意义(双关语)
任何人都能解释为什么会这样吗?
opengl ×3
c++ ×2
comparison ×1
cycle ×1
derivative ×1
flash ×1
frame-rate ×1
glsl ×1
performance ×1
point ×1
textures ×1