Jump to content

ByterDance

Members
  • Posts

    11
  • Joined

  • Last visited

ByterDance's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. At the time of forge 1.16.5, I used this code: RenderSystem.enableBlend(); RenderSystem.disableAlphaTest(); RenderSystem.defaultBlendFunc(); // render RenderSystem.disableBlend(); RenderSystem.enableAlphaTest(); But when switching to version 1.20.1, I ran into a problem: GL_ALPHA_TEST cap can no longer be enabled, and if you specify any color with alpha less than 1.0 in the shader, then the pixel color will still be with alpha 1.0 My current code: Shader: #version 330 core out vec4 fragColor; void main() { fragColor = vec4(1.0, 0.0, 0.0, 0.5); } @SubscribeEvent public static void registerShader(RegisterShadersEvent event) { try { event.registerShader(new ShaderInstance(event.getResourceProvider(), new ResourceLocation("untitled", "tst"), DefaultVertexFormat.POSITION), instance -> { shaderInstance = instance; }); } catch (IOException e) { e.printStackTrace(); } } @SubscribeEvent public void render2D(RenderGuiOverlayEvent.Post event) { RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); RenderSystem.setShader(() -> shaderInstance); Tesselator tesselator = Tesselator.getInstance(); BufferBuilder bufferBuilder = tesselator.getBuilder(); bufferBuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION); bufferBuilder.vertex(0, 0, 0).endVertex(); bufferBuilder.vertex(0, 50, 0).endVertex(); bufferBuilder.vertex(100, 50, 0).endVertex(); bufferBuilder.vertex(100, 0, 0).endVertex(); tesselator.end(); RenderSystem.disableBlend(); } If anything, the shader itself is working. I also tried rendering using POSITION_TEX vertex format, but nothing has changed.
  2. Okay, this error was easy for me. If someone also wants to know where they are, then: Go to: C:\Users\your_user\.gradle\caches\forge_gradle\mcp_repo\net\minecraft\mapping\1.16.5 Then open mappings-%version%-mapping.zip. Replace %version% with your version (for me its 1.16.5) How did I figure it out? I downloaded sources for ForgeGradle-4.1.0 (which is inherent in version 1.16.5). After analyzing the sources, I found a mention of the fields.srg file in the file MCPRepo.java: On these lines, the fields.srg file is added to the zip file that is written above: mcpversion is your version (1.16.5) Then all you need is to go to the specified path and pull 2 files from the archive:
  3. I downloaded mcp_config for version 1.16.5 and found mappings in the joined.tsrg file, but there are no renamed names for fields and methods in them. Where I can find it? In MCPBot latest version of mappings is 1.15 If you write to me "version 1.16.5 is not supported on the forum" then give at least a link to the mappings of version 1.18
  4. Do you have an iq hopefully greater than 0? You are a volunteer, which means you have no reason not to help me because I gave the "cheat" as an example. If you simply can't answer what I said (what works on MCP, but not on forge), then I don't see the point in shitting something on the forum. If you are a stupid macaque who writes supposedly "important things" on the forum, but cannot give what the author needs, then you are doing something wrong. My friend always understands me and tries to help, but you are busy filling in the subject of unnecessary messages. By topic: either forge is broken, or I don't understand why the same RenderWorldLastEvent call code in the same place works differently. By you: couldn't give me what I need and couldn't answer the question why everything works on MCP, but not on forge. Thank you for your shit in my topic, I hope you get banned fuck
  5. Don't ignore me if you see the word "cheat", it's crazy
  6. one more point, can you please understand it correctly, everything works perfectly in MCP 1.16.5 (ModCoderPack), but for some reason everything works differently on forge. P.S. Please understand and forgive me, I asked a friend for Tracers from his cheat on minecraft (these are lines from the bottom of the screen to the player), but everything works completely differently on Forge Tracers code if you need: Vector3d centerScreen = mc.player.getLookVec(); for (PlayerEntity entity : mc.world.getPlayers()) { double x = entity.getPosX() - mc.getRenderManager().info.getProjectedView().x; double y = entity.getPosY() - mc.getRenderManager().info.getProjectedView().y; double z = entity.getPosZ() - mc.getRenderManager().info.getProjectedView().z; bufferBuilder.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR); bufferBuilder.pos(centerScreen.getX(), centerScreen.getY(), centerScreen.getZ()).color(red, green, blue, alpha).endVertex(); bufferBuilder.pos(x, y, z).color(red, green, blue, alpha).endVertex(); Tessellator.getInstance().draw(); } This code works well on MCP, but works wrong on Forge
  7. Is it really so difficult to help with drawing lines for two blocks instead of filling the topic with comments?
  8. facepalm So I wrote here
  9. Yes, in this thread he's projects 3d coordinate from world to 2d screen coordinates, but I want to render it in RenderWorldLastEvent without projecting But you can't draw through it anyway. Rendering takes place through Tessellator and BufferBuilder or directly through OpenGL, but not through RenderSystem
  10. And what am I doing wrong? I do all the same things What??? If you are about com.mojang.blaze3d.systems.RenderSystem, then this is a utility + alternative to GlStateManager, you can't draw through it But if you draw on the "monitor screen" (RenderGameOverlayEvent), then almost everything you said will not work
  11. I'm trying to draw a line that will go from the left block to the right. I have the code: @SubscribeEvent public void onRender3D(RenderWorldLastEvent event) { GL11.glColor4f(1, 1, 1, 1); GLUtils.start2Draw(() -> { Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferBuilder = tessellator.getBuilder(); bufferBuilder.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); bufferBuilder.vertex(event.getProjectionMatrix(), 10, 76, 475).endVertex(); bufferBuilder.vertex(event.getProjectionMatrix(), 10, 76, 466).endVertex(); tessellator.end(); }); } Event is called, only the render does not work. Of course I can do as in this thread, but I think it's a crutch. If I add - gameRenderer.getMainCamera().getPosition() it will have an invalid effect:
×
×
  • Create New...

Important Information

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