Question by
alchemist_wurzelpurzel · Oct 11, 2021 at 03:05 PM ·
meshgraphicsuniversalgl
GL API with CommandBuffer in URP
I am trying to use the following code in URP 10.6.0, Unity 2020.3.17f1:
public static void IndexedGraphicsBlit(RenderTexture destination)
{
RenderTexture.active = destination;
GL.PushMatrix();
GL.LoadOrtho();
GL.Begin(GL.QUADS);
// Bottom left corner.
GL.MultiTexCoord2(0, 0.0f, 0.0f);
GL.Vertex3(0.0f, 0.0f, 3.0f);
// Bottom right corner.
GL.MultiTexCoord2(0, 1.0f, 0.0f);
GL.Vertex3(1.0f, 0.0f, 2.0f);
// Top right corner.
GL.MultiTexCoord2(0, 1.0f, 1.0f);
GL.Vertex3(1.0f, 1.0f, 1.0f);
// Top left corner.
GL.MultiTexCoord2(0, 0.0f, 1.0f);
GL.Vertex3(0.0f, 1.0f, 0.0f);
GL.End();
GL.PopMatrix();
RenderTexture.active = null;
}
I have read that URP does not support the GL library here: https://forum.unity.com/threads/gl-draw-in-hdrp.858259/
So now I am trying to make it work with a CommandBuffer. Does anyone know how to do this?
Comment
Your answer
Follow this Question
Related Questions
Mesh & Shadow crash on Android platform build 0 Answers
How to draw mesh on texture,How to draw Mesh to texture 0 Answers
URP Scene pink, materials fine in Project window 1 Answer
How could I implement a "border" system for my medieval game? 0 Answers
How to efficiently lay down 3D level architecture like tiles? 0 Answers