本文整理汇总了Java中org.lwjgl.opengl.GL20.glEnableVertexAttribArray方法的典型用法代码示例。如果您正苦于以下问题:Java GL20.glEnableVertexAttribArray方法的具体用法?Java GL20.glEnableVertexAttribArray怎么用?Java GL20.glEnableVertexAttribArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL20
的用法示例。
在下文中一共展示了GL20.glEnableVertexAttribArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareTexturedModel
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
private void prepareTexturedModel(final TexturedModel model) {
GL30.glBindVertexArray(model.getRawModel().getVaoId());
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
if (model.getTexture().isHasTransparency()) {
MasterRenderer.disableCulling();
}
shader.loadFakeLightingVariable(model.getTexture().isUseFakeLighting());
shader.loadShineVariables(
model.getTexture().getShineDamper(),
model.getTexture().getReflectivity()
);
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getTextureId());
}
示例2: render
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static final void render(final Vec3 position, final float scale) {
shader.start();
GL30.glBindVertexArray(model.id);
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
shader.loadTransformationMatrix(MatrixCreation.createTransformationMatrix(position, new Vec3(), new Vec3(scale, 1, scale)));
GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, model.vertexCount);
GL20.glDisableVertexAttribArray(0);
GL20.glDisableVertexAttribArray(1);
GL20.glDisableVertexAttribArray(2);
GL30.glBindVertexArray(0);
shader.stop();
}
示例3: preRenderChunkLayer
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static void preRenderChunkLayer(BlockRenderLayer blockLayerIn)
{
if (Shaders.isRenderBackFace(blockLayerIn))
{
GlStateManager.disableCull();
}
if (OpenGlHelper.useVbo())
{
GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib);
GL20.glEnableVertexAttribArray(Shaders.tangentAttrib);
GL20.glEnableVertexAttribArray(Shaders.entityAttrib);
}
}
示例4: prepareTerrain
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
private void prepareTerrain(Terrain terrain) {
RawModel rawModel = terrain.getModel();
GL30.glBindVertexArray(rawModel.getVaoID());
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
bindTextures(terrain);
shader.loadShineVariables(1, 0);
}
示例5: prepareTerrain
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
private void prepareTerrain(final Terrain terrain) {
GL30.glBindVertexArray(terrain.getModel().getVaoId());
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
shader.loadShineVariables(
terrain.getTexture().getShineDamper(),
terrain.getTexture().getReflectivity()
);
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, terrain.getTexture().getTextureId());
}
示例6: bind
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
/**
* Start using vertex array
*/
public void bind(){
glBindVertexArray(vaoId);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indicesId);
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
}
示例7: prepareTexturedModel
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
private void prepareTexturedModel(TexturedModel model) {
RawModel rawModel = model.getRawModel();
GL30.glBindVertexArray(rawModel.getVaoID());
GL20.glEnableVertexAttribArray(0); // position coordinates
GL20.glEnableVertexAttribArray(1); // texture coordinates
GL20.glEnableVertexAttribArray(2); // normal coordinates
ModelTexture texture = model.getTexture();
shader.loadShineVariable(texture.getShineDamper(), texture.getReflectivity());
GL13.glActiveTexture(GL13.GL_TEXTURE0); // activate texture bank - where sampler function will sample
GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
}
示例8: drawArrays
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static void drawArrays(int drawMode, int first, int count, VertexBuffer wrr)
{
if (count != 0)
{
VertexFormat vertexformat = wrr.getVertexFormat();
int i = vertexformat.getNextOffset();
if (i == 56)
{
ByteBuffer bytebuffer = wrr.getByteBuffer();
bytebuffer.position(32);
GL20.glVertexAttribPointer(Shaders.midTexCoordAttrib, 2, GL11.GL_FLOAT, false, i, bytebuffer);
bytebuffer.position(40);
GL20.glVertexAttribPointer(Shaders.tangentAttrib, 4, GL11.GL_SHORT, false, i, bytebuffer);
bytebuffer.position(48);
GL20.glVertexAttribPointer(Shaders.entityAttrib, 3, GL11.GL_SHORT, false, i, bytebuffer);
bytebuffer.position(0);
GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib);
GL20.glEnableVertexAttribArray(Shaders.tangentAttrib);
GL20.glEnableVertexAttribArray(Shaders.entityAttrib);
GL11.glDrawArrays(drawMode, first, count);
GL20.glDisableVertexAttribArray(Shaders.midTexCoordAttrib);
GL20.glDisableVertexAttribArray(Shaders.tangentAttrib);
GL20.glDisableVertexAttribArray(Shaders.entityAttrib);
}
else
{
GL11.glDrawArrays(drawMode, first, count);
}
}
}
示例9: prepareTerrain
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
private void prepareTerrain(Terrain terrain) {
RawModel rawModel = terrain.getModel();
GL30.glBindVertexArray(rawModel.getVaoID());
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
ModelTexture texture = terrain.getTexture();
shader.loadshineVariable(texture.getShineDamper(), texture.getReflectivity());
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture.getID());
}
示例10: prepareTerrain
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
/**
* Binds texture for shaders and rendering
* @param terrain - terrain containing the texture.
*/
private void prepareTerrain(Terrain terrain) {
RawModel rawModel = terrain.getModel();
GL30.glBindVertexArray(rawModel.getVaoID());
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
bindTextures(terrain);
UniformList.terrainShineDamper.loadData(1);
UniformList.terrainReflectivity.loadData(0);
}
示例11: drawArrays
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static void drawArrays(int drawMode, int first, int count, WorldRenderer wrr)
{
if (count != 0)
{
VertexFormat vertexformat = wrr.getVertexFormat();
int i = vertexformat.getNextOffset();
if (i == 56)
{
ByteBuffer bytebuffer = wrr.getByteBuffer();
bytebuffer.position(32);
GL20.glVertexAttribPointer(Shaders.midTexCoordAttrib, 2, GL11.GL_FLOAT, false, i, bytebuffer);
bytebuffer.position(40);
GL20.glVertexAttribPointer(Shaders.tangentAttrib, 4, GL11.GL_SHORT, false, i, bytebuffer);
bytebuffer.position(48);
GL20.glVertexAttribPointer(Shaders.entityAttrib, 3, GL11.GL_SHORT, false, i, bytebuffer);
bytebuffer.position(0);
GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib);
GL20.glEnableVertexAttribArray(Shaders.tangentAttrib);
GL20.glEnableVertexAttribArray(Shaders.entityAttrib);
GL11.glDrawArrays(drawMode, first, count);
GL20.glDisableVertexAttribArray(Shaders.midTexCoordAttrib);
GL20.glDisableVertexAttribArray(Shaders.tangentAttrib);
GL20.glDisableVertexAttribArray(Shaders.entityAttrib);
}
else
{
GL11.glDrawArrays(drawMode, first, count);
}
}
}
示例12: preRenderChunkLayer
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static void preRenderChunkLayer()
{
if (OpenGlHelper.useVbo())
{
GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib);
GL20.glEnableVertexAttribArray(Shaders.tangentAttrib);
GL20.glEnableVertexAttribArray(Shaders.entityAttrib);
}
}
示例13: bind
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public void bind()
{
GL30.glBindVertexArray(this.handle);
for(int i = 0; i < this.vertexBuffers.length; ++i)
{
if (this.vertexBuffers[i] != null)
{
GL20.glEnableVertexAttribArray(i);
}
}
}
示例14: bind
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public void bind(int... attributes){
bind();
for (int i : attributes) {
GL20.glEnableVertexAttribArray(i);
}
}
示例15: enableAttributes
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
/**
* Enables all the stored attributes
*/
protected void enableAttributes() {
for (int i = 0; i < attributes; i++)
GL20.glEnableVertexAttribArray(i);
}