Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Ok, so I have particle effects that have their own texture file, and on top of that, the texture file is generated at startup and only the opengl reference ID is kept. So far, I haven't even found a way to hook a physical file, let alone simply an int id. This is what I am doing now:

public void renderParticle(...)
//...rendering variable initialization and calculations here

par1Tessellator.draw(); //to flush the tessalator

//Do all my GL11_ calls directly here, including color setting, using the tesselators api here usually doesnt work after a flush.
GL11.glBindTexture(GL11.GL_TEXTURE_2D, MyIntGL11BoundTextureID); //to get the integer id with assembled BufferedImages, do a renderEngine.allocateAndSetupTexture(BufferedImage)

par1Tessellator.startDrawingQuads();

par1Tessellator.addVertexWithUV(...);
par1Tessellator.addVertexWithUV(...);
par1Tessellator.addVertexWithUV(...);
par1Tessellator.addVertexWithUV(...);

//Now flush reset settings, and restart the quad drawing.
par1Tessellator.draw();
//Reset all GL_ settings back to their originals
GL11.glBindTexture(GL11.GL_TEXTURE_2D, renderEngine.getTexture("/gui/items.png"));
par1Tessellator.startDrawingQuads();

That method works... mostly, except we are flushing the tesselators buffer that is not full, and it causes some really odd things to happen. Using layer 2 reduces this to a minimum, but it can still cause oddities, like missing colors/flickering colors. I could also choose not to flush before the tesselation, but this causes even worse issues, my texture leaking into other effects.

 

Does anyone know of a better way to do this, or some calls I might be missing? I currently only set the basics, blendfunc, color4f and depthtest(requires a flush unless you are on acid). If anyone has any info let me know, right now I am just trying to keep the problems at a minimum by  flushing before and after my rendering.

Did you look at normal particle code? They have icon index stuff in there to use a physical file in there

  • Author

Did you look at normal particle code? They have icon index stuff in there to use a physical file in there

What kind of question is that? Are you going to ask me if my computer is plugged in? God, its tech support all over again. -_-

 

Btw, I figured it out, at least, what seems to work for me. If you make all your GL11 calls after you draw+startDrawingQuads(), then reset them after your final draw and before the final startDrawingQuads(), the color loss doesn't seem to happen, at least not for me.  Maybe that can help another with a similar problem. Also it seems to help to do a GL11 color call AND a tesselator color call, in case colordisabled is set, setting one or the other doesn't seem to be 100%

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.