Jump to content

Render Image on Screen rippling


delpi

Recommended Posts

I have a cooldown bar I'm rendering on the screen.  It works great and does exactly what i want, but as the bar goes down, the bar has a rippling effect in portions of it and I can't figure out why.

 

Basically I render the empty bar which has black in the middle.  Then I render a portion of a red image that is the exact same shape as the black from the first.

 

I'm assuming I need some type of GL call to solve this issue but I don't know what.  I tried looking at the stuff for  health and boss health, but it doesn't seem to work for this.  They are using a blending call only as near as I can tell.  Tried their exact same one but no dice.

 

Anybody had experience with this?

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

Hi

 

Could be you are trying to render two things to exactly the same z depth?  If you have depth culling turned on, the two will fight each other to be on top, which leads to a nasty stripy/ripply effect.

 

You could try turning off depth culling, or try rendering the red one very slightly in front of the black.

 

-TGG

Link to comment
Share on other sites

I don't think it will be the lighting.  The patten of the ripple is too exact.  It is happening the exact same way every time no matter the location or situation.  But, to be sure, I'll test it tonight with the GL calls.

 

TheGreyGhost,

this sounds promissing.  I've never been totally sure what the z was used for.  Which way is into the screen and out of the screen.  Currently, they are at -90 since that was what I saw used most commonly in minecraft for gui stuff.

 

If the default background one is at -90, I'm betting I move out to soemthing like -100?  Minecraft seems to like -z as a forward motion.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

Almost correct. The smaller the number the further back it is. The higher the number, the closer to the front it is. So you want to be drawing your black texture at a z level of say -89 and the red texture at z level -88. That would put your red above your black.

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Link to comment
Share on other sites

Ok, neither of those worked.  I really thought the z one sounded right.

 

turning the lighting off didn't make any change.

 

Moving it around on the z didn't either except I can put the red behind the black and I see nothing.

 

Any more ideas?

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

I'll try a screenshot or two tonight.  But it looks like a shadow of black moving down the red image, and then solid red, and then it will ripple down from top to bottom again.  Does it every few hours.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

 

Currently trying these options

 

 

GL11.glEnable(GL11.GL_DEPTH_TEST);

GL11.glEnable(GL11.GL_BLEND);

GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

 

 

 

 

Looks something like this.  The black lines will move down from the top of the red to the bottom.

 

width=272 height=353https://sites.google.com/site/clandoolittle/home/dimension-manager/Capture.PNG?attredirects=0[/img]

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

I'll try a screenshot or two tonight.  But it looks like a shadow of black moving down the red image, and then solid red, and then it will ripple down from top to bottom again.  Does it every few hours.

 

Do you really mean "every few hours"?  Like it is a very slow precession of the ripple through your image?  If so, it might be more of a fundamental graphics driver thing, like a screen tearing like effect.  Could even be something weird in your monitor hardware itself.  Do you see the same thing if you run the mod on another computer?

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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