Jump to content

Search the Community

Showing results for tags 'rendering'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Minecraft Forge
    • Releases
    • Support & Bug Reports
    • Suggestions
    • General Discussion
  • Mod Developer Central
    • Modder Support
    • User Submitted Tutorials
  • Non-Forge
    • Site News (non-forge)
    • Minecraft General
    • Off-topic
  • Forge Mods
    • Mods

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


XMPP/GTalk


Gender


URL


Location


ICQ


AIM


Yahoo IM


MSN Messenger


Personal Text

Found 16 results

  1. Here is my code: @Mod.EventBusSubscriber(modid = Mod.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class PlayerRenderModifications { @SubscribeEvent public static void prePlayerRender(RenderPlayerEvent.Pre evt) { RenderSystem.setShaderColor(0.0F, 1.0F, 1.0F, 1.0F); } @SubscribeEvent public static void postPlayerRender(RenderPlayerEvent.Post evt) { RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); } } This code is supposed to tint the player blue, however it doesn't tint the player at all (yes i know it only runs in f5 mode or when rendering players in multiplayer). I had also done some testing and it seems if I remove "postPlayerRender" then it tints the player, and also tints everything else that renders after the player (like other entities, clouds, etc.) If you need me to provide other information then go ahead and ask!
  2. I got a working post processing shader inside assets/shaders/post but now I'm stuck at, having my mod run the shader. How would I go about that?
  3. Title explains it all, I think. I'm attempting to make an armor set that extends from DyeableArmorItem instead of ArmorItem and for some reason the armor model's color is not changing in-game. While the dye crafting recipes work, the resulting "tint colors" are not showing up on my character or on the inventory icon (except for the "Dyed" tag). Any assistance?
  4. Like the title i wanted to render a obj model into minecraft but i cant find any tutorials for this.
  5. So i know for a fact this has been asked before but Render stuff troubles me a little and i didnt find any answer for recent version. I have a custom nausea effect. Currently i add both my nausea effect and the vanilla one for the effect. But the problem is that when I open the inventory, both are listed, while I'd only want mine to show up (both in the inv and on the GUI) I've arrived to the GameRender (on joined/net/minecraft/client) and also found shaders on client-extra/assets/minecraft/shaders/post and client-extra/assets/minecraft/shaders/program but I'm lost. I understand that its like a regular screen, where I'd render stuff "over" the game depending on data on the server, but If someone could point to the right client and server classes that i can read to see how i can manage this or any tip would be apreciated
  6. Hi everyone! I'm learning modding on forge 1.16.5 and want to make the Leviathan Axe from the God of War games, but I'm facing two problems: 1) The entity model in the air and on the ground when thrown is not rendered 2) There's no sound of picking up the axe Moreover, when thrown, the entity itself spawns, that is, it causes damage, falls, creates sounds of falling and hitting other entities, but the axe model is not visible. I registered the renderer in the doClientStuff method in the main class of the mod, but still the model is not rendered. Renderer class: LeviathanAxeRenderer Model class: LeviathanAxeModel Entity class: LeviathanAxeEntity Item Class: LeviathanAxeItem I hope this information is enough to help me resolve the issue, if not I will be happy to provide more. I would be very grateful for your help, I’ve been struggling with this for a day now and can’t figure out what the problem is
  7. I succeeded in rendering quads. However, they go dark when players are above them. Like these picture : https://drive.google.com/file/d/1zdbiE-pmGk3VuLy5ZSPtPDo-4UpHcKsa/view?usp=sharing https://drive.google.com/file/d/1AgJv2ncXjqRGh_oTURNCtVdMfDWws8s2/view?usp=sharing Is there something wrong with my codes? public class RenderTester implements BlockEntityRenderer<BlockEntityTester> { private static final ResourceLocation GRAVEL_TEXTURE = new ResourceLocation("textures/block/gravel.png"); public RenderTester (BlockEntityRendererProvider.Context context) {} @Override public void render(@NotNull BlockEntityTester pBlockEntity, float pPartialTick, @NotNull PoseStack pPoseStack, @NotNull MultiBufferSource pBuffer, int pPackedLight, int pPackedOverlay) { VertexConsumer builder = pBuffer.getBuffer(RenderType.entityCutoutNoCull(GRAVEL_TEXTURE)); BufferUtil.drawQuad(builder, pPoseStack, 0.0F, 1.0F, 0.0F, 1.0F, 1.0F, 1.0F, 0.0F, 0.0F, 1.0F, 1.0F, pPackedLight, pPackedOverlay, 0xFFFFFFFF); } } public class BufferUtil { public static void drawVertex(VertexConsumer builder, PoseStack poseStack, float x, float y, float z, float u, float v, int packedLight, int pPackedOverlay, int color) { builder.vertex(poseStack.last().pose(), x, y, z) .color(color) .uv(u, v) .overlayCoords(pPackedOverlay) .uv2(packedLight) .normal(0, 1, 0) .endVertex(); } public static void drawQuad(VertexConsumer builder, PoseStack poseStack, float x0, float y0, float z0, float x1, float y1, float z1, float u0, float v0, float u1, float v1, int packedLight, int pPackedOverlay, int color) { drawVertex(builder, poseStack, x0, y0, z0, u0, v0, packedLight, pPackedOverlay, color); drawVertex(builder, poseStack, x0, y1, z1, u0, v1, packedLight, pPackedOverlay, color); drawVertex(builder, poseStack, x1, y1, z1, u1, v1, packedLight, pPackedOverlay, color); drawVertex(builder, poseStack, x1, y0, z0, u1, v0, packedLight, pPackedOverlay, color); } }
  8. I have made a post shader with all of it's files (in post and program) being finished, it's just an edited creeper post shader for now. How do I load it ingame? Minecraft.getInstance().gameRenderer.loadEffect(new ResourceLocation("thedefused:shaders/post/creep.json")); This just gives an error due to it trying to find program in minecraft:shaders/program However, I have seen multiple mods use post shaders. how?
  9. I want to make a custom sky, moon, sun, fog, etc. How would I do this?
  10. I have been researching existing topics related to this question for a while, but unfortunately, they are all outdated. I tried to understand the principle of such rendering from the debug code (displaying the view direction, displaying hitboxes), but to no avail. In one of the topics (Forum link) where this question was discussed, there was a reference to "some really old code, but has the relevant math" (GitHub link), which I tried to update (spoiler below), but it didn't yield any results. Nothing gets rendered. Does anyone know of projects that use custom rendering of simple shapes (lines/squares/circles) so that I can investigate their source code? Or can anyone help fix existing code? In general, any information on this matter would be helpful) More information about the code: The code is called for two blocks located on the same level. The initiation of this code call is through the RenderLevelStageEvent event, where the getStage method returns the value AFTER_TRIPWIRE_BLOCKS. The drawLine method is precisely called on the necessary blocks, and there are no error messages during this process.
  11. Hi, I'm having an issue with my block entities (it's currently two) where the model isn't rendering correctly. Not only is there no texture, but the custom model also isn't there; it appears as the standard Minecraft square. I'm not sure why this is happening, because I used the exact same method for another block entity and the model works perfectly fine. I checked the .json file and it's referencing everything correctly. Even weirder, the item model is completely fine; it's just an issue when I place it. Below I'll send the .json and the Block class of one of the block entities. If you need any more files, I'd be glad to send them! .json file: { "credit": "Made with Blockbench", "texture_size": [128, 128], "textures": { "0": "darkcollective:block/fabricatormk1", "particle": "darkcollective:block/fabricatormk1" }, "elements": [ { "name": "fabricator", "from": [1, 8, -6], "to": [2, 16, -5], "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [0.875, 0.125, 1, 1.125], "texture": "#0"}, "east": {"uv": [0.75, 0.125, 0.875, 1.125], "texture": "#0"}, "south": {"uv": [1.125, 0.125, 1.25, 1.125], "texture": "#0"}, "west": {"uv": [1, 0.125, 1.125, 1.125], "texture": "#0"}, "up": {"uv": [1, 0.125, 0.875, 0], "texture": "#0"}, "down": {"uv": [1.125, 0, 1, 0.125], "texture": "#0"} } }, { "name": "fabricator", "from": [0, 8, 0], "to": [16, 16, 16], "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [2, 2, 4, 3], "texture": "#0"}, "east": {"uv": [0, 2, 2, 3], "texture": "#0"}, "south": {"uv": [6, 2, 8, 3], "texture": "#0"}, "west": {"uv": [4, 2, 6, 3], "texture": "#0"}, "up": {"uv": [4, 2, 2, 0], "texture": "#0"}, "down": {"uv": [6, 0, 4, 2], "texture": "#0"} } }, { "name": "fabricator", "from": [1, 0, 0], "to": [15, 8, 16], "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [2, 5, 3.75, 6], "texture": "#0"}, "east": {"uv": [0, 5, 2, 6], "texture": "#0"}, "south": {"uv": [5.75, 5, 7.5, 6], "texture": "#0"}, "west": {"uv": [3.75, 5, 5.75, 6], "texture": "#0"}, "up": {"uv": [3.75, 5, 2, 3], "texture": "#0"}, "down": {"uv": [5.5, 3, 3.75, 5], "texture": "#0"} } }, { "name": "fabricator", "from": [15, 0, 4], "to": [16, 7, 12], "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [4.25, 8.875, 4.375, 9.75], "texture": "#0"}, "east": {"uv": [3.25, 8.875, 4.25, 9.75], "texture": "#0"}, "south": {"uv": [5.375, 8.875, 5.5, 9.75], "texture": "#0"}, "west": {"uv": [4.375, 8.875, 5.375, 9.75], "texture": "#0"}, "up": {"uv": [4.375, 8.875, 4.25, 7.875], "texture": "#0"}, "down": {"uv": [4.5, 7.875, 4.375, 8.875], "texture": "#0"} } }, { "name": "fabricator", "from": [0, 0, 4], "to": [1, 7, 12], "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [6.75, 8.5, 6.875, 9.375], "texture": "#0"}, "east": {"uv": [5.75, 8.5, 6.75, 9.375], "texture": "#0"}, "south": {"uv": [7.875, 8.5, 8, 9.375], "texture": "#0"}, "west": {"uv": [6.875, 8.5, 7.875, 9.375], "texture": "#0"}, "up": {"uv": [6.875, 8.5, 6.75, 7.5], "texture": "#0"}, "down": {"uv": [7, 7.5, 6.875, 8.5], "texture": "#0"} } }, { "name": "fabricator", "from": [1, 16, -14], "to": [2, 17, 2], "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [8, 3, 8.125, 3.125], "texture": "#0"}, "east": {"uv": [6, 3, 8, 3.125], "texture": "#0"}, "south": {"uv": [10.125, 3, 10.25, 3.125], "texture": "#0"}, "west": {"uv": [8.125, 3, 10.125, 3.125], "texture": "#0"}, "up": {"uv": [8.125, 3, 8, 1], "texture": "#0"}, "down": {"uv": [8.25, 1, 8.125, 3], "texture": "#0"} } }, { "name": "fabricator", "from": [0, 16, 3], "to": [16, 28, 5], "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [2.5, 6.375, 4.5, 7.875], "texture": "#0"}, "east": {"uv": [2.25, 6.375, 2.5, 7.875], "texture": "#0"}, "south": {"uv": [4.75, 6.375, 6.75, 7.875], "texture": "#0"}, "west": {"uv": [4.5, 6.375, 4.75, 7.875], "texture": "#0"}, "up": {"uv": [4.5, 6.375, 2.5, 6.125], "texture": "#0"}, "down": {"uv": [6.5, 6.125, 4.5, 6.375], "texture": "#0"} } }, { "name": "fabricator", "from": [3, 17, 2], "to": [13, 27, 3], "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [6.875, 6.25, 8.125, 7.5], "texture": "#0"}, "east": {"uv": [6.75, 6.25, 6.875, 7.5], "texture": "#0"}, "south": {"uv": [8.25, 6.25, 9.5, 7.5], "texture": "#0"}, "west": {"uv": [8.125, 6.25, 8.25, 7.5], "texture": "#0"}, "up": {"uv": [8.125, 6.25, 6.875, 6.125], "texture": "#0"}, "down": {"uv": [9.375, 6.125, 8.125, 6.25], "texture": "#0"} } }, { "name": "fabricator", "from": [14, 16, -14], "to": [15, 17, 2], "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [2, 8, 2.125, 8.125], "texture": "#0"}, "east": {"uv": [0, 8, 2, 8.125], "texture": "#0"}, "south": {"uv": [4.125, 8, 4.25, 8.125], "texture": "#0"}, "west": {"uv": [2.125, 8, 4.125, 8.125], "texture": "#0"}, "up": {"uv": [2.125, 8, 2, 6], "texture": "#0"}, "down": {"uv": [2.25, 6, 2.125, 8], "texture": "#0"} } }, { "name": "fabricator", "from": [14, 8, -6], "to": [15, 16, -5], "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [1.375, 0.125, 1.5, 1.125], "texture": "#0"}, "east": {"uv": [1.25, 0.125, 1.375, 1.125], "texture": "#0"}, "south": {"uv": [1.625, 0.125, 1.75, 1.125], "texture": "#0"}, "west": {"uv": [1.5, 0.125, 1.625, 1.125], "texture": "#0"}, "up": {"uv": [1.5, 0.125, 1.375, 0], "texture": "#0"}, "down": {"uv": [1.625, 0, 1.5, 0.125], "texture": "#0"} } }, { "name": "fabricator", "from": [7, 16, -14], "to": [9, 17, 2], "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [7.5, 6, 7.75, 6.125], "texture": "#0"}, "east": {"uv": [5.5, 6, 7.5, 6.125], "texture": "#0"}, "south": {"uv": [9.75, 6, 10, 6.125], "texture": "#0"}, "west": {"uv": [7.75, 6, 9.75, 6.125], "texture": "#0"}, "up": {"uv": [7.75, 6, 7.5, 4], "texture": "#0"}, "down": {"uv": [8, 4, 7.75, 6], "texture": "#0"} } }, { "name": "fabricator", "from": [7, 8, -6], "to": [9, 16, -5], "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 8]}, "faces": { "north": {"uv": [0.125, 0.125, 0.375, 1.125], "texture": "#0"}, "east": {"uv": [0, 0.125, 0.125, 1.125], "texture": "#0"}, "south": {"uv": [0.5, 0.125, 0.75, 1.125], "texture": "#0"}, "west": {"uv": [0.375, 0.125, 0.5, 1.125], "texture": "#0"}, "up": {"uv": [0.375, 0.125, 0.125, 0], "texture": "#0"}, "down": {"uv": [0.625, 0, 0.375, 0.125], "texture": "#0"} } } ], "display": { "thirdperson_righthand": { "rotation": [70, 0, 0], "translation": [0, 1, 0.25], "scale": [0.25, 0.25, 0.25] }, "thirdperson_lefthand": { "rotation": [70, 0, 0], "scale": [0.25, 0.25, 0.25] }, "firstperson_righthand": { "scale": [0.4, 0.4, 0.4] }, "firstperson_lefthand": { "scale": [0.4, 0.4, 0.4] }, "ground": { "scale": [0.4, 0.4, 0.4] }, "gui": { "rotation": [0, 126, 0], "translation": [0, -2.75, 0], "scale": [0.5, 0.5, 0.5] }, "fixed": { "translation": [0, -1.5, 0], "scale": [0.4, 0.4, 0.4] } }, "groups": [ { "name": "fabricator", "origin": [8, 0, 8], "color": 0, "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] } ] } Block class: private static final VoxelShape SHAPE = makeShape(); public FabricatorMK1(BlockBehaviour.Properties properties) { super(properties); } @Override public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext ctx) { return SHAPE; } @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { return BlockEntityInit.FABRICATORMK1_ENTITY.get().create(pos, state); } @Override public void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) { if(state.getBlock() != newState.getBlock()){ BlockEntity blockEntity = level.getBlockEntity(pos); if (blockEntity instanceof FabricatorMK1Entity){ ((FabricatorMK1Entity) blockEntity).drops(); } } } @Override public RenderShape getRenderShape(BlockState state) { return RenderShape.MODEL; } @Override protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { super.createBlockStateDefinition(builder); builder.add(HorizontalDirectionalBlock.FACING); } @Nullable @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { return defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, ctx.getHorizontalDirection().getOpposite()); } @Override public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand interactionHand, BlockHitResult result) { if(!level.isClientSide()) { BlockEntity entity = level.getBlockEntity(pos); if (entity instanceof FabricatorMK1Entity) { NetworkHooks.openScreen(((ServerPlayer)player), (FabricatorMK1Entity)entity, pos); } else { throw new IllegalStateException("Our Container provider is missing!"); } } return InteractionResult.sidedSuccess(level.isClientSide()); } @Nullable @Override public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> type) { if(level.isClientSide()) { return null; } return createTickerHelper(type, BlockEntityInit.FABRICATORMK1_ENTITY.get(), (level1, pos, state1, blockEntity) -> blockEntity.tick(level1, pos, state1)); } public static VoxelShape makeShape(){ VoxelShape SHAPE = Shapes.empty(); SHAPE = Shapes.join(SHAPE, Shapes.box(0.0625, 0.5, -0.375, 0.125, 1, -0.3125), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0, 0.5, 0, 1, 1, 1), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.0625, 0, 0, 0.9375, 0.5, 1), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.9375, 0, 0.25, 1, 0.4375, 0.75), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0, 0, 0.25, 0.0625, 0.4375, 0.75), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.0625, 1, -0.875, 0.125, 1.0625, 0.125), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0, 1, 0.1875, 1, 1.75, 0.3125), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.1875, 1.0625, 0.125, 0.8125, 1.6875, 0.1875), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.875, 1, -0.875, 0.9375, 1.0625, 0.125), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.875, 0.5, -0.375, 0.9375, 1, -0.3125), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.4375, 1, -0.875, 0.5625, 1.0625, 0.125), BooleanOp.OR); SHAPE = Shapes.join(SHAPE, Shapes.box(0.4375, 0.5, -0.375, 0.5625, 1, -0.3125), BooleanOp.OR); return SHAPE; } I also have a GitHub where you can find the necessary files for the Fabricator (Block entity in question):https://github.com/giornoggiovanna/DarkCollectiveGit Thanks for the help!
  12. Hello there I have been trying to rotate player upside down but can`t for some reason I tried many events and codes but still not able and the latest code I used is this package net.skatric.tutorialmod.event; import com.mojang.math.Axis; import net.minecraft.client.model.PlayerModel; import net.minecraft.client.player.AbstractClientPlayer; import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.skatric.tutorialmod.TutorialMod; import org.lwjgl.opengl.GL11; @Mod.EventBusSubscriber(modid = TutorialMod.MOD_ID,bus = Mod.EventBusSubscriber.Bus.FORGE) public class bodyrotation { static boolean checking = false; @SubscribeEvent public static void event(RenderPlayerEvent.Pre event) { if (checking == false) { checking = true; PlayerModel<AbstractClientPlayer> model = event.getRenderer().getModel(); event.getPoseStack().mulPose(Axis.XN.rotationDegrees(0f)); event.getPoseStack().mulPose(Axis.YN.rotationDegrees(0f)); event.getPoseStack().mulPose(Axis.ZN.rotationDegrees(180f)); } } }
  13. How to make an entity have a short animation when an event is triggered?
  14. I've created a spear item which, when used, throws a custom arrow entity. I've set up a renderer which is basically copied from the vanilla arrow renderers, and it does nearly what I want. The only problem is that I've used a custom texture which is based on the format of the arrow texture but longer than the vanilla arrow (here is the image file). But when the entity renders, it cuts off the longer part and shortens it to the length of a vanilla arrow. Here is my render class, (all the code is on github): So, all I want to know is, where in the rendering code does it define the length of the rendered entity and the section of the image that it uses. I am completely confused by the way most rendering code works, and it's not documented well enough for me to figure it out by reading. Can anyone point me in the right direction?
  15. I am working on updating my mod from 1.7.10 to 1.8.9. In 1.7 i had an inventory that can hold a single block and that block changes the look of the block to the one in the inventory. but with the new json rendering thing i have no idea about how to even touch this. if you can give me any information about how to get this done, I would be grateful.
×
×
  • Create New...

Important Information

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