Jump to content

zskamljic

Members
  • Posts

    19
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

zskamljic's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I've got the rendering down (for a POC), if anyone needs the code it's available here, it procuces something like this: I think I'll also need to be needing to adjust the UVs a bit, but this is a great starting point. Now, I'm wondering if it's possible to obtain vertices from a VoxelShape? Looks like VoxelShape.bounds() returns AABB which fits my needs. Looks like there's more to UVs though. There's UV0 and UV2 in the quad vertices, but UV2 seems to be used for overlay, and UV0 only has 2 floats, which seem to match texture uv0, which by the way, is not 0, nor does it go to 1. Instead values (for stone, for example) seem to look like this: 0.40629607,0.78134215; 0.40629607,0.81240785; 0.42182893,0.81240785; 0.42182893,0.78134215, which has me at a loss of what they mean, or what I am supposed to do with them to get the desired result
  2. Hm, rendering the faces would be enough for me (at least for the time being), but I'm somewhat lost on the last part of the loop. I see that the quads have a sprite attached to them, so I assume rendering a subset of that sprite would be what I want, and for that it appears I need to manipulate vertices in the quad. Looking at the buffer code in VertexConsumer.putBulkData I was able to extract vertices that fit the face, so I'll try manipulating those and report back. Thanks for the tip!
  3. I'm not sure if you're joking? I'm looking to render faces, obtained from a block model to a voxel shape that is determined at runtime. I would prefer not to do (4096 * (blocks I want the model for)) models, if there's a way to render those at runtime.
  4. I am not looking to create stairs specifically, I'm looking to apply (almost) any block's faces to different shapes, also I want to do multiple shapes as well, not something I'd want to manually model and skin for every possible combination.
  5. I am looking for a way to render a part of a block, for example slabs and stairs (but from other blocks that don't have their stair variants as well (basically same textures on a different shape). I have found a way to render the model via this code, and rendering the model does work, but I am having issues with finding a way to render only part of the said block, is there a way to "clip" the rendered model? Or at least get the faces and render them on a clipped model?
  6. Do you have a constructor in MobKillerBE? Something like: public MobKillerBE(BlockPos position, BlockState state) { ... }
  7. I have tried creating a "proxy" BlockAndTintGetter, based on my debugging only getShade, getLightEngine and getBlockState are called, changing values returned by getShade seems to darken the block (closer to 0f) or use default color (closer to 1f), getBlockTint (which I expected to return ARGB int does not seem to get called at all. I have also tried changing buffer color, but it appears to be ignored there. By digging through the code, I have discovered that in VertexConsumer interface, one of the overloads of putBulkData is used, with alpha set to 1. The answer was to proxy the VertextConsumer and override the default method putBulkData, using custom alpha value. I have updated the original gist with the "solution", but it still feels like there should be a cleaner way to achieve this.
  8. I have tried creating a "proxy" BlockAndTintGetter, based on my debugging only getShade, getLightEngine and getBlockState are called, changing values returned by getShade seems to darken the block (closer to 0f) or use default color (closer to 1f), getBlockTint (which I expected to return ARGB int does not seem to get called at all. I have also tried changing buffer color, but it appears to be ignored there.
  9. That works perfectly! Thanks! Is there a similar way to also change the alpha of the block? The following does not appear to work: RenderSystem.setShaderColor(1f, 1f, 1f, 0.1f);
  10. I was looking into this topic, and trying to update it to 1.19.2, and came up with this so far. As it happens, it seems like the block is rendered at camera origin, despite my intention to render it in a specific block position. Am I even using the right event? Am I rendering the block correctly? Translating the poseStack to all 0 does not seem to be helping either.
  11. thanks @ChampionAsh5357 that is exactly what I was looking for!
  12. @warjort please see the spoiler in the original post for my model file. You were right, I had a typo that I have missed. I am familiar with JSON, but the wiki, including the link provided, and the link to models page has little to offer in terms of properties that can be used, the values that can be used and so on. For example I didn't find a documentation on faces, there's "front" but no "back", so I used "north" and "south", but that took time to find as well.
  13. are the model files documented anywhere? I didn't have any luck on finding any sort of info on them. Adding `"render_typ": "cutout",` to the top didn't change anything.
  14. I was trying to implement a component similar to redstone comparator, but I'm having issues with the model when powered, but it displays as following: The model is specified as following: Which is the same as what I've found the redstone repeater use, but for that, it is rendered correctly. Adding ambiendocclusion causes the whole top of the block to appear dark, aside from there I can not spot a difference. How do I solve this?
  15. Thanks for the explanation, this makes sense! Do you perhaps also know the registry event that are fired?
×
×
  • Create New...

Important Information

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