Jump to content

Recommended Posts

Posted

 

    public void drawSimpleImage(int posX, int posY, int width, int height) {
        GL11.glPushMatrix();
        GL11.glTranslatef((float) posX, (float) posY, 0.0f);
        GL11.glBegin(7);
        GL11.glTexCoord2f(0.0f, 0.0f);
        GL11.glVertex3f(0.0f, 0.0f, 0.0f);
        GL11.glTexCoord2f(0.0f, 1.0f);
        GL11.glVertex3f(0.0f, (float) height, 0.0f);
        GL11.glTexCoord2f(1.0f, 1.0f);
        GL11.glVertex3f((float) width, (float) height, 0.0f);
        GL11.glTexCoord2f(1.0f, 0.0f);
        GL11.glVertex3f((float) width, 0.0f, 0.0f);
        GL11.glEnd();
        GL11.glPopMatrix();
    }

I have this method to draw images.

The problem is when I draw big images in a small scale they look very pixilated.

Is there any way to make like clean edges or something like that on the rendered image?

Posted

I'm assuming that you meant to write SMALL images at BIG scale; big images at small scale on the screen are always going to look pixelated on the screen because it doesn't have enough pixels on the monitor to represent all of the data.

The "Texture Filtering" section of this page should help you with changing the way images are upscaled: https://learnopengl.com/Getting-started/Textures

Also I obviously don't have any context based on what you posted but as a general rule you shouldn't have to be writing OpenGL directly in a Forge mod. Advanced topics like this aren't covered very much in the official Forge documentation but I would HIGHLY recommend that you look up the GitHub for another mod that has similar rendering features to your own to make sure that there's not a cleaner way to accomplish them.

Website: jdawg3636.com
Discord: discord.gg/EKeM7Jz

Posted

No big images in small scale look also ugly. that's the problem.

They don't look ugly when i zoom out in chrome or something.

That's the problem.

 

and thanks for the page ^^

I will read it tomorrow 

Posted
11 minutes ago, MenschenToaster said:

They don't look ugly when i zoom out in chrome or something.

That's the problem.

That's a function of interpolation. Chrome's pretty good at it. Raw OGL is not.

If you scale the images down to the desired size yourself you'll have the most control.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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