Jump to content

Recommended Posts

Posted

Hello everyone,

I've got a probably very dumb question.

I've created an entity that is supposed to be rendered without lighting and stuff, so that it can be seen in the dark.

However, I discovered that if two entities are onscreen, the one that is rendered later is way too bright.

I probably messed up with opengl at some point, but I cannot figure out where.

This is the entity how it should look like:

 

  Reveal hidden contents

 

And this is the entity how it looks when another one is rendered before:

 

  Reveal hidden contents

 

 

Here is my rendering code:

 

  Reveal hidden contents

 

(hope you understand it)

 

Thanks in advance for your efford.

 

EDIT: It has probably something to do with the blend function, because in front of the black background of the sky, it is rendered normal.

Posted
  On 9/16/2015 at 4:20 PM, Bedrock_Miner said:

I did post even two screenshot, they're inside the first two spoiler boxes, if you haven't found them yet.

 

Changing the order of pushAttrib and pushMatrix didn't change anything.

 

Yes, cuz you do not have anything in those pushAttrib() methods. But its just cleaner.

Posted

Please try changing blend function into

GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE)

&

GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ZERO)

and take screenshots of them, for debug purpose.

(Because it might be problem of blending)

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted
  On 9/21/2015 at 8:50 PM, Warix said:

It looks like 2 entities spawned at same location so it looks brighter.

They are not 2 entities, see the new screenshots I made:

 

First, as it was before. I just rotated the head a bit until the other entity comes into sight, I changed nothing else:

 

  Reveal hidden contents

 

Second with ONE:

 

  Reveal hidden contents

 

Third with ZERO:

 

  Reveal hidden contents

 

 

I hope this helps you...

Posted

Strange. It seems like blending function does not applied when 2 entities are drawn.

I think it is reset to the GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE) then, but idk why.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

  • 3 weeks later...
Posted

It's getting even weirder...

 

I ran a GL State checker over it and the differences between the two rendering modes are those:

[20:03:53] [Client thread/INFO] [minersbasic]: GL_VERTEX_ARRAY_STRIDE: 28 -> 16 (Stride between vertices)
[20:03:53] [Client thread/INFO] [minersbasic]: GL_COLOR_ARRAY_STRIDE: 28 -> 16 (Stride between colors)
[20:03:53] [Client thread/INFO] [minersbasic]: GL_TEXTURE_COORD_ARRAY_STRIDE: 28 -> 20 (Stride between texture coordinates)

(Left side is normal, right side is wrongly rendered)

 

I actually don't know what they mean, but maybe anyone knows?

 

Also I discovered that other Entities are affected as well, even if no shooting star is nearby. Here's a screenshot of Items being rendered weirdly when laying next to one:

 

  Reveal hidden contents

 

Also, the bows of skeletons show that halfway-transparent look.

I really need a way to fix it, it's so annoying...

 

EDIT: I think I have found out something useful: It does work if I call

GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

instead of

GlStateManagerdisableLighting();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

 

Is there maybe something that I don't understand with the GLStateManager?

And, even more important, is it OK when I do it like that or do I break something else with it? Or should I maybe call both?

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.