Jump to content

Recommended Posts

Posted

Hello,

I'm having a render problem with a block... when you look at the top from a very low angle you can see through the top of my block: https://imgur.com/a/VUA2dnV.

In the image you can see that the purple symbol on the top is still visible. This is because it sits on a different quad than the rest of the blocks top.

there is a square with this purple symbol with zero thickness 0.1 pixels above the top of the block. I'm doing this because the symbol gets rendered at full brightness using IBakedModel (This is why it seems like its glowing).

I have set the rendertype for the entire block to translucent because the square has zero alpha pixels and 20 alpha pixels.

 

Maybe it has something to do with me setting the render type of the block to translucent? I only really need this one quad with the symbol to be rendered translucent,

is it possible to only render a single quad translucent and the rest solid?

Posted

I have tried the multi layer model but it wont render the translucent part... The solid part is there though

"translucent": {
    "textures": {
      "3": "witchcraftmod:blocks/modelled/ritual_stone/4"
    },
      "elements": [
        {
          "from": [3, 12.1, 3],
          "to": [13, 12.1, 13],
          "faces": {
            "north": {"uv": [0, 0, 8, 0], "texture": "#3"},
            "east": {"uv": [0, 0, 8, 0], "texture": "#3"},
            "south": {"uv": [0, 0, 8, 0], "texture": "#3"},
            "west": {"uv": [0, 0, 8, 0], "texture": "#3"},
            "up": {"uv": [0, 0, 16, 16], "texture": "#3"},
            "down": {"uv": [0, 0, 8, 8], "texture": "#3"}
          }
        }
      ]
  }

This is the translucent part, in the game its just not there at all :( The texture is definitely correct though

Posted

Try this:

 

  // does the Glass Lantern render in the given layer (RenderType) - used as Predicate<RenderType> lambda for setRenderLayer
  public static boolean isGlassLanternValidLayer(RenderType layerToCheck) {
    return layerToCheck == RenderType.getCutout() || layerToCheck == RenderType.getTranslucent();
  }

 

-TGG

Posted

It's still not putting the translucent texture onj the block... It does work on the blockitem though. I have tried only having it render the translucent part and that worked so it seems like the block cant have more than one RenderType at once... Any other ideas? If nothing works i will try using a TESR

Posted
  On 5/8/2020 at 6:51 AM, xX_deadbush_Xx said:

It's still not putting the translucent texture onj the block... It does work on the blockitem though. I have tried only having it render the translucent part and that worked so it seems like the block cant have more than one RenderType at once... Any other ideas? If nothing works i will try using a TESR

Expand  

Blocks can have more than one render layer. Have you tried TheGreyGhost’s solution?

Some tips:

  Reveal hidden contents

 

Posted

Please post your code.

Some tips:

  Reveal hidden contents

 

Posted

Model json:

https://pastebin.com/t0GwXURU

RenderType:

//in client setup
RenderTypeLookup.setRenderLayer(ModBlocks.RITUAL_STONE.get(), RenderHelper::isSolidOrTranslucent);

//in RenderHelper
public static boolean isSolidOrTranslucent(RenderType layerToCheck) {
	return layerToCheck == RenderType.getSolid() || layerToCheck == RenderType.getTranslucent();
}

Is there anything else I need to do?

Posted

Hi

BTW your translucent texture should only have the up face, and none of the others on that element.

 

If it renders translucent in item but not block, it's almost certainly a renderlayer problem.  Are you sure the setRenderLayer is being executed and the RITUAL_STONE is correct?

 

What happens if you swap the order of translucent and solid?  It shouldn't matter, but it might show up  a subtle problem in your json.

You could consider simplifying your model to two simple elements then putting a breakpoint into MultiLayerModel.Loader to see whether your json file is being parsed as you expect

You could try putting a breakpoint into isSolidOrTranslucent and seeing if it's called when you place your block into the world; alternatively in ChunkRenderDispatcher::compile with a conditional breakpoint, or in MultiLayerModel::getQuads to see whether the quads are being rendered (and you just can't see them). 

 

Painful trial and error was the only way that worked for me unfortunately

 

-TGG

 

 

 

 

Posted

Okay I think I just figured out what the problem is. As I said I'm rendering the top texture at full brightness and appearently that works differently for MultiLayerModels. I will see if I can figure out how to make it work for MultiLayerModels too. Thank you for your help

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I am trying to install forge 1.20.1 but after installing java 8 144, it only quickly opens a cmd prompt then recloses it without anything else happening. Any help?
    • This is a hopefully quick question, but I'm tryin to slow down the player and have reduced the movement speed attribute, which works as long as the player is on the ground, however when the player is sprint jumping their speed is only slightly slower than a actual player(For reference there movement speed is 0.5 of it's original value)
    • Hello there! I developing a mod, that will be allow to spawn a hologram of the player. So i need, that a hologram has a skin of owner. I don't sure how to do that, 'cause if i just place a path to standart steve skin, that will lead for same skin on all holograms. Btw, is it posible to dynamicly add an another layer to player's skin? For creating a small diffusing. Can anyone share some ideas? (will be perfect if i don't must be use an openGL API and something)
    • I've been running a very old instance of Forge on my 1.18.2 server (40.2.5) and would like to upgrade it, but if I install any version past that, Minecraft won't load.  It doesn't crash, it just brings up the command prompt and hangs until I close it.  I'm guessing it's some sort of mod incompatibility, but I have no idea how to tell.  Here's my debug log: https://mclo.gs/7Chnf4a
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
×
×
  • Create New...

Important Information

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