Jump to content

[1.5.2][solved] Rendering something transparent inside something opaque


Recommended Posts

Posted

This problem has been fixed.

 

  On 5/6/2013 at 8:41 PM, Busti said:

You need to enable the alpha drawing like this:

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

        model.renderModelPart();
        
        GL11.glDisable(GL11.GL_BLEND);

 

then it will work.

 

Make sure to render the Transparent part after Everything else!

 

Hi there, in my mod I have a wine barrel, and I'd like the wine in the barrel to be transparent but still render the (then visible) parts of the block behind it. Here, have some screenshots of what happens with render pass 1:

 

  Reveal hidden contents

 

And with render pass 0:

 

  Reveal hidden contents

 

As you can see, it isn't rendering the parts of the block behind the wine, and on render pass 0, it just looks plain ugly.

Is there a way to do this, and if so, how?

 

Have my code:

BlockWineBarrel:

 

  Reveal hidden contents

 

RenderHandlerBarrel:

 

  Reveal hidden contents

 

 

And I also have another problem, which is that the specially rendered blocks have been rendering without lighting effects in the GUI since 1.5.2:

(Too lazy to open up a new thread)

 

  Reveal hidden contents

 

Posted

I don't know if you've ever made wine in real life (I have) but with render pass 1 the wine looks really thin, like water. In my country you can barely see through a cup of wine, if you can even see at all. I think render pass 0 looks accurate, especially for a small barrel.

 

on a technical point of view, that's an engine issue, there's no fixing it.

Did I help? Hitting 'Thank You' would be appreciated.

 

Soon, the lost city will rise from the bottom of the ocean, and spread it's technology across Minecraft.

Posted

You need to enable the alpha drawing like this:

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

        model.renderModelPart();
        
        GL11.glDisable(GL11.GL_BLEND);

 

then it will work.

 

Make sure to render the Transparent part after Everything else!

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted
  On 5/6/2013 at 7:04 PM, LordFokas said:

I don't know if you've ever made wine in real life (I have) but with render pass 1 the wine looks really thin, like water. In my country you can barely see through a cup of wine, if you can even see at all. I think render pass 0 looks accurate, especially for a small barrel.

 

on a technical point of view, that's an engine issue, there's no fixing it.

 

Well yeah, It would be a lot thicker. But it just looks fabulous when it's transparent!  :o

Posted

Your problem is that you only have 1 "bottom" quad, which you're drawing your wine texture on.

 

Right now your barrels inside faces get shorter as you add wine, which is why you can't see the inside walls when you render as transparent.

 

What you need is to draw using render pass 1, but add another quad that is the surface of your wine.  That quad will change based on your metadata, but the rest of your barrel won't.

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.

Posted
  On 5/6/2013 at 8:41 PM, Busti said:

You need to enable the alpha drawing like this:

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

        model.renderModelPart();
        
        GL11.glDisable(GL11.GL_BLEND);

 

then it will work.

 

Make sure to render the Transparent part after Everything else!

 

Wow, thanks! :D adding to post

 

Posted
  On 5/8/2013 at 4:11 PM, Draco18s said:

Your problem is that you only have 1 "bottom" quad, which you're drawing your wine texture on.

 

Right now your barrels inside faces get shorter as you add wine, which is why you can't see the inside walls when you render as transparent.

 

What you need is to draw using render pass 1, but add another quad that is the surface of your wine.  That quad will change based on your metadata, but the rest of your barrel won't.

 

 

That's actually exactly the way it is. It worked with Busti's solution and the bottom of the barrel (wood) is still visible :P

Posted
  On 5/8/2013 at 5:38 PM, juliand665 said:

That's actually exactly the way it is. It worked with Busti's solution and the bottom of the barrel (wood) is still visible :P

 

Wasn't able to tell. ;)

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.