Jump to content

[Resolved]3D rendering in HUD


Recommended Posts

Ok I have encountered a bit of problem that is leaving me scratching my head a bit.


I am rendering a living entity onto the HUD, and I have it working great except for one small problem.


If there is an image on the same X as my rendered object, it becomes affected by lighting, and if the sky is the backdrop, the sky changes colors slightly.


I have tried disabling all the common features after my render, but nothing seems to be fixing the issue.(Yes, I did try doing a GL11.glDisable(GL11.GL_LIGHTING), this does not work, it still causes images to be effected by lighting.


I will point out that I am using the entities current renderer to do my rendering, I just translate, rotate and scale it into place, and I have been setting up my environment the normal way with entityRenderer.setupOverlayRendering(Although it makes no difference it seems whether I do this or not).


Here is my relavent rendering code:

RenderLiving ren = (RenderLiving) RenderManager.instance.getEntityClassRenderObject(el.getClass());
GL11.glTranslatef(locX, locY, 0);
GL11.glRotatef(180, 0, 0, 1);
GL11.glScaled(25, 25, 25);
ren.doRender(el, 1, 1, 1, 0, 0);


Anyone got a clue?


Edit:  I solved it with a GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); So it's all good now :)

(That pushes the current settings stack, so when you pop the stack, they are restored)

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.

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.