Drawing lines on the screen on WorldRenderEvents.LAST
When I enable shaders, lines rendering works with below code (but it looks like my lines are affected by postprocessing shaders):
However when I use my own custom lines renderer with my own shaders - nothing is rendered. It is very basic code with compiling shaders, creating program, VBO/VAO, uploading buffer,
GL30.glDrawArrays(GL30.GL_LINES, 0, buffer.vertices());
, etc
Any idea why my low level code doesn't draw anything?4 Replies
this is due to how shaders inherently work
sorry for the late reply btw
shaders do not render to the main framebuffer ever, but rather to arbritary color textures with their own information
they then composite this information together
WorldRenderEvents.LAST is still too early
you'd need to do it at the very end of renderLevel
thanks for the reply!
shaders do not render to the main framebuffer ever, but rather to arbritary color textures with their own informationI am not switching framebuffers, does this mean I still draw to the wrong framebuffer while doing some draw calls from WorldRenderEvents.LAST?
you'd need to do it at the very end of renderLevelInitially I was working with my own mixins to achieve effect of WorldRenderEvents.LAST event (because my mod is for both forge/fabric) but then ppl started complaining that my mod doesn't work with sodium I noticed my mixin into
LevelRenderer.renderLevel
doesn't get hit (I suppose because of sodium overwrites this method or something like this)
Then I switched to WorldRenderEvents.LAST, which is somehow is getting triggered by sodium
What would be the best way to draw something at the very end of renderLevel? Should I still switch to correct framebuffer here?Iris has special sanity checks, mods can never render stuff on their own when an Iris shader is meant to be active
any writes to the main framebuffer will be disabled
mixin into renderLevel RETURN should work fine
thanks, I will try that
it works perfectly, thanks again!