What is the best way of drawing a Geometry with a custom shader without using a Camera?
I am basically trying to render a square that takes the entire viewport (PlaneBufferGeometry), using my own shader (RawShaderMaterial), without using any projection (gl_position is linearly bound to the vertex position).
Thanks for your answer. I find it weird that you always need a Camera, in this special case you don’t need to go through a projection matrix, the relation between the vertex position and the viewport position is linear.
But fair enough, I will pass a fake Camera to WebGLRenderer.render but I won’t use the projection matrix.
Well, the point of the Camera is to provide a projection matrix in shaders, right? So if you don’t need a projection matrix, I don’t see why you would need to create a Camera.
It does more than just that, setting up clipping planes, frustum to perform culling etc. it isn’t the primary thing you do with THREE rendering just a quad, you can also set quad.frustumCulled to false.
If all you need for your project is a quad with shader i would suggest using WebGL directly.
In my case it’s for a RTT, for a complicated effect. It will not use clipping, culling or anything from the camera.
I also need a more classical scene with a camera, that will make use of the RTT result as a texture. So it makes sense using ThreeJS instead of WebGL directly.
Anyway, I am fine passing the camera to the render method, it just feels weird when you look at the code.
Idk, maybe I misunderstood, but from my quick glance at the code and your not using the camera I concluded that you basically calculate the entire screen