本文整理汇总了Java中org.lwjgl.opengl.GL13类的典型用法代码示例。如果您正苦于以下问题:Java GL13类的具体用法?Java GL13怎么用?Java GL13使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GL13类属于org.lwjgl.opengl包,在下文中一共展示了GL13类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareTexturedModel
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
private void prepareTexturedModel(TexturedModel model) {
RawModel rawModel = model.getRawModel();
GL30.glBindVertexArray(rawModel.getVaoID());
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
ModelTexture texture = model.getTexture();
if(texture.isHasTransparency()) {
MasterRenderer.disableCulling();
}
shader.loadFakeLightingVariable(texture.isUseFakeLighting());
shader.loadShineVariables(texture.getShineDamper(), texture.getReflectivity());
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
}
示例2: renderParticle
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
public void renderParticle(Tessellator tessellator, float f, float f1, float f2, float f3, float f4, float f5)
{
float f6 = ((float)field_678_p + f) / (float)field_677_q;
f6 *= f6;
double d = field_675_a.posX;
double d1 = field_675_a.posY;
double d2 = field_675_a.posZ;
double d3 = field_679_o.lastTickPosX + (field_679_o.posX - field_679_o.lastTickPosX) * (double)f;
double d4 = field_679_o.lastTickPosY + (field_679_o.posY - field_679_o.lastTickPosY) * (double)f + (double)field_676_r;
double d5 = field_679_o.lastTickPosZ + (field_679_o.posZ - field_679_o.lastTickPosZ) * (double)f;
double d6 = d + (d3 - d) * (double)f6;
double d7 = d1 + (d4 - d1) * (double)f6;
double d8 = d2 + (d5 - d2) * (double)f6;
int i = MathHelper.floor_double(d6);
int j = MathHelper.floor_double(d7 + (double)(yOffset / 2.0F));
int k = MathHelper.floor_double(d8);
int l = getRenderBrightness(f);
int i1 = l % 0x10000;
int j1 = l / 0x10000;
GL13.glMultiTexCoord2f(33985 /*GL_TEXTURE1_ARB*/, (float)i1 / 1.0F, (float)j1 / 1.0F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
d6 -= interpPosX;
d7 -= interpPosY;
d8 -= interpPosZ;
RenderManager.instance.renderEntityWithPosYaw(field_675_a, (float)d6, (float)d7, (float)d8, field_675_a.rotationYaw, f);
}
示例3: render
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
/**
* Renders the water.
* @param camera
*/
public void render(final PerspectiveCamera camera, final DirectionalLight light) {
shader.bind();
shader.setUniform("m_model", transformation);
shader.setUniform("m_view", camera.getView());
shader.setUniform("m_proj", camera.getProjection());
shader.setUniform("move_factor", moveFactor);
shader.setUniform("camera_pos", camera.getPosition());
shader.setUniform("light_pos", light.getDirection().negate(null));
framebuffer.bindTexture();
dudvTexture.bind(GL13.GL_TEXTURE1);
normalTexture.bind(GL13.GL_TEXTURE2);
MESH.render();
}
示例4: initGL
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
/**
* Initialize OpenGL to default settings
*/
private void initGL() {
// Set the clear color
GL11.glClearColor(0, 0, 0, 1);
// Setup viewport
GL11.glViewport(0, 0, WINDOW.getWidth(), WINDOW.getHeight());
// Setup depth testing
GL11.glEnable(GL11.GL_DEPTH_TEST);
// Setup face culling (ccw)
GL11.glFrontFace(GL11.GL_CCW);
GL11.glCullFace(GL11.GL_BACK);
GL11.glEnable(GL11.GL_CULL_FACE);
// Setup blending
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
// Enable MSAA
GL11.glEnable(GL13.GL_MULTISAMPLE);
}
示例5: prepareTexturedModel
import org.lwjgl.opengl.GL13; //导入依赖的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());
}
示例6: createTexture
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
/**
* Creates an OpenGL texture based on a given Image
* @param id OpenGL reference id to create texture in
* @param image
*/
private void createTexture(int id, Image image) {
// Set as texture 0
GL13.glActiveTexture(GL13.GL_TEXTURE0);
bind();
// Set pixel storage mode
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
// Setup texture
GL11.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GL11.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
GL11.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width, image.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image.buffer);
GL30.glGenerateMipmap(GL11.GL_TEXTURE_2D);
unbind();
}
示例7: bindTextures
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
/**
* Binds each texture to a the terrain shaders.
* @param terrain - Terrain containing the textures to blend.
*/
private void bindTextures(Terrain terrain) {
TerrainTexturePack texturePack = terrain.getTexturePack();
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texturePack.getBackgroundTexture().getTextureID());
GL13.glActiveTexture(GL13.GL_TEXTURE1);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texturePack.getRedTexture().getTextureID());
GL13.glActiveTexture(GL13.GL_TEXTURE2);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texturePack.getGreenTexture().getTextureID());
GL13.glActiveTexture(GL13.GL_TEXTURE3);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texturePack.getBlueTexture().getTextureID());
GL13.glActiveTexture(GL13.GL_TEXTURE4);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texturePack.getBlendMap().getTextureID());
}
示例8: setLightmapTextureCoords
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
/**
* Sets the current coordinates of the given lightmap texture
*/
public static void setLightmapTextureCoords(int target, float p_77475_1_, float p_77475_2_)
{
if (arbMultitexture)
{
ARBMultitexture.glMultiTexCoord2fARB(target, p_77475_1_, p_77475_2_);
}
else
{
GL13.glMultiTexCoord2f(target, p_77475_1_, p_77475_2_);
}
if (target == lightmapTexUnit)
{
lastBrightnessX = p_77475_1_;
lastBrightnessY = p_77475_2_;
}
}
示例9: checkBoundTexture
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
public static void checkBoundTexture()
{
if (Config.isMinecraftThread())
{
int i = GL11.glGetInteger(GL13.GL_ACTIVE_TEXTURE);
int j = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
int k = getActiveTextureUnit();
int l = getBoundTexture();
if (l > 0)
{
if (i != k || j != l)
{
Config.dbg("checkTexture: act: " + k + ", glAct: " + i + ", tex: " + l + ", glTex: " + j);
}
}
}
}
示例10: setLightmapTextureCoords
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
/**
* Sets the current coordinates of the given lightmap texture
*/
public static void setLightmapTextureCoords(int target, float p_77475_1_, float t)
{
if (arbMultitexture)
{
ARBMultitexture.glMultiTexCoord2fARB(target, p_77475_1_, t);
}
else
{
GL13.glMultiTexCoord2f(target, p_77475_1_, t);
}
if (target == lightmapTexUnit)
{
lastBrightnessX = p_77475_1_;
lastBrightnessY = t;
}
}
示例11: createDisplay
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
public static void createDisplay() {
try {
Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
ContextAttribs attribs = new ContextAttribs(3, 2).withProfileCore(true).withForwardCompatible(true);
Display.create(new PixelFormat().withDepthBits(24).withSamples(4), attribs);
Display.setTitle(TITLE);
Display.setInitialBackground(1, 1, 1);
GL11.glEnable(GL13.GL_MULTISAMPLE);
} catch (LWJGLException e) {
e.printStackTrace();
System.err.println("Couldn't create display!");
System.exit(-1);
}
GL11.glViewport(0, 0, WIDTH, HEIGHT);
lastFrameTime = getCurrentTime();
}
示例12: loadCubeMap
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
public static int loadCubeMap(MyFile[] textureFiles) {
int texID = GL11.glGenTextures();
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL13.GL_TEXTURE_CUBE_MAP, texID);
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
for (int i = 0; i < textureFiles.length; i++) {
TextureData data = decodeTextureFile(textureFiles[i]);
GL11.glTexImage2D(GL13.GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL11.GL_RGBA, data.getWidth(),
data.getHeight(), 0, GL12.GL_BGRA, GL11.GL_UNSIGNED_BYTE, data.getBuffer());
}
GL11.glTexParameteri(GL13.GL_TEXTURE_CUBE_MAP, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
GL11.glTexParameteri(GL13.GL_TEXTURE_CUBE_MAP, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
GL11.glTexParameteri(GL13.GL_TEXTURE_CUBE_MAP, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE);
GL11.glTexParameteri(GL13.GL_TEXTURE_CUBE_MAP, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE);
GL11.glBindTexture(GL13.GL_TEXTURE_CUBE_MAP, 0);
return texID;
}
示例13: render
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
public void render(List<GuiTexture> guis){
shader.start();
GL30.glBindVertexArray(quad.getVaoID());
GL20.glEnableVertexAttribArray(0);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDisable(GL11.GL_DEPTH_TEST);
for(GuiTexture gui: guis){
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, gui.getTexture());
Matrix4f matrix = Maths.createTransformationMatrix(gui.getPosition(), gui.getScale());
shader.loadTransformation(matrix);
GL11.glDrawArrays(GL11.GL_TRIANGLE_STRIP, 0, quad.getVertexCount());
}
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_BLEND);
GL20.glDisableVertexAttribArray(0);
GL30.glBindVertexArray(0);
shader.stop();
}
示例14: prepareTexturedModel
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
private void prepareTexturedModel(TexturedModel model) {
RawModel rawModel = model.getRawModel();
GL30.glBindVertexArray(rawModel.getVaoID());
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
ModelTexture texture = model.getTexture();
shader.loadNumberOfRows(texture.getNumberOfRows());
if(texture.isHasTransparency()){
MasterRenderer.disableCulling();
}
shader.loadFakeLightingVariable(texture.isUseFakeLighting());
shader.loadShineVariables(texture.getShineDamper(), texture.getReflectivity());
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
}
示例15: createDisplay
import org.lwjgl.opengl.GL13; //导入依赖的package包/类
public static void createDisplay() {
ContextAttribs attribs = new ContextAttribs(3, 3)
.withForwardCompatible(true)
.withProfileCore(true);
try {
Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
Display.create(new PixelFormat(), attribs);
Display.setTitle("Our First Display!");
GL11.glEnable(GL13.GL_MULTISAMPLE);
} catch (LWJGLException e) {
e.printStackTrace();
}
GL11.glViewport(0, 0, WIDTH, HEIGHT);
lastFrameTime = getCurrentTime();
}