But I really cannot figure out how to get the "vec3 iNearPositionVert" and "vec3 iFarPositionVert".
I guess it is the near and far plane of the camera frustum, but how can I find it with GLScene or directly in the shader?
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Jerome!
Thanks! That seems to work, but still my code doesn't work...
I will try to figure out what's wrong.
Here is the files if someone wants to try to solve it.
and for the vertex normaly like ine the link you gave
#version130invec3P; // position attr from the vbooutvec3vertexPosition; // vertex position for the fragment shadervoidmain() {
vertexPosition=P.xyz;gl_Position=vec4(P, 1);
}
Hi!
I am trying out this tutorial: https://github.com/martin-pr/possumwood/wiki/Infinite-ground-plane-using-GLSL-shaders
But I really cannot figure out how to get the "vec3 iNearPositionVert" and "vec3 iFarPositionVert".
I guess it is the near and far plane of the camera frustum, but how can I find it with GLScene or directly in the shader?
Cheers
Hi Daniel you can get far and near in
GLSceneViewer1.Buffer.RenderingContext.PipelineTransformation.Frustum
But i think you should create a new shader like Shaders i've made (ex GLYvoryShader) and retreive frustrum in DoApply method with rci
Cheers
Last edit: Jerome.D (BeanzMaster) 2020-05-06
Hi Jerome!
Thanks! That seems to work, but still my code doesn't work...
I will try to figure out what's wrong.
Here is the files if someone wants to try to solve it.
Vertex shader:
Frag shader:
Hi Daniel i 've took a llok at the site web you give i think the better approch is using raymarch
Like here https://www.shadertoy.com/view/Ws2yWd
This the FragShader with only the chessboard plane ;)
and for the vertex normaly like ine the link you gave
it Should work
A very cool site for beginning with raymarching
http://xdpixel.com/category/ray-marching/
and this little article for a symply floor https://www.geeks3d.com/20130524/building-worlds-with-distance-functions-in-glsl-raymarching-glslhacker-tutorial-opengl/3/
Cheers