Posted April 12, 20196 yr Hey, here I am again! This time with an error I don't know why it's caused, I am basically trying to load the minecraft phosphor shader. Using entityRenderer#loadShader. Each time I perform this however, it spams my console with this specific error: [13:26:08] [Client thread/WARN] [minecraft/ShaderManager]: Could not find uniform named InSize in the specified shader program. I don't know what causes this and when googling it I find no solution/explanation of the problem. Any thoughts? (I'll post the code if needed) Thanks for taking your time with reading this!
April 13, 20196 yr Author I render my code in the RenderGameOverlayEvent.Post, it simply starts spamming the error once it loads private static final ResourceLocation motionblur = new ResourceLocation("shaders/post/phosphor.json"); public void onHUDrender(RenderGameOverlayEvent.Post render) { Minecraft.getMinecraft().addScheduledTask(new Runnable() { @Override public void run() { if (Minecraft.getMinecraft().player != null) { EntityPlayerSP player = Minecraft.getMinecraft().player; if (Minecraft.getMinecraft().entityRenderer.isShaderActive()) { if (TempStorage.instance.getMyScreen()) { Minecraft.getMinecraft().entityRenderer.stopUseShader(); TempStorage.instance.setMyScreen(false); } } else if (TempStorage.instance.getFreezeKeyBoard()) { if (TempStorage.instance.getFreezeKeyBoard()) { Minecraft.getMinecraft().entityRenderer.loadShader(motionblur); TempStorage.instance.setMyScreen(true); } } } } }); }
April 13, 20196 yr Why are you scheduling this as a task to the client thread? Shader binding must be done on the GL/render thread. Also the player should never be null during RenderGameOverlay event. Additionally rendergameoverlay event fires multiple times per frame per element being rendered. You need to check the one currently rendered.
April 13, 20196 yr Author That makes sense now you say it. How do I switch to the GL/render thread though? (Sorry if this is some basic question I could've found in 20 mins googling)
April 14, 20196 yr Author That's why I tried running it on the main thread, because I got the same error when not having it run on the main thread. (I changed the code a bit, for some reason I double check freezeKeyBoard? I am pretty blind sometimes) Fixed it by changing the code a bit, for some reason I thought I'd be smart to load and unload it in the same tick. Ty for your help though! Edited April 14, 20196 yr by Naomiora
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.