Hi!
I'm trying to make the FBOrenderer only save a texture of the scene while a clipplane is enabled, and as soon as it's done, disable the clipplane and render the scene normally.
This is what I have in the sceneViewers beforeRender:
Hi, this demo need some work in code tor be compatible with Lazarus. The best way is to make a child of TGLSLCustomShader like the simple water shader i've done.
You need translate all opengl Command ike glCommandNameb become *GL.CommandName*
After accessing matrix not working like in the original delphi code
Have you try Ocean demo in samples/shader/glsl/ocean ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, I have used that demo and it helped me with other parts.
In this case I'm interested in reflection on objects on a surface, and using a clipplane to only reflect parts above the surface.
I'm trying to use the FBORenderer for the sampler2D in the shader.
But I cannot make it create the texture while the clipplane is enabled, and then disable the clipplane again.
I will upload a test case when I have one.
Currently I have a hard time making the FBORenderer work at all...
Cheers!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A few lines who generate errors:
gl.LoadMatrixf(@FScene.CurrentBuffer.ModelMatrix); // incompatible types, Matrix4f expected single
FScene.CurrentBuffer.PopModelViewMatrix; // no identified member
gl.LoadMatrixf(FScene.CurrentBuffer.ModelMatrix); // incompatible types, Matrix4f expected single
Any idea what's wrong here?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
I'm trying to make the FBOrenderer only save a texture of the scene while a clipplane is enabled, and as soon as it's done, disable the clipplane and render the scene normally.
This is what I have in the sceneViewers beforeRender:
The texture in the materiallibrary becomes weird...
If I don't disable the clipplane, then the texture is ok.
Any idea how I can save only the clipped scene to a texture?
Cheers
Hi Daniel, can you make a simple test case ?
Have you try with the FBO's onBefore/OnAfter event ? Take a look in examples/effects/shadowfbo demo
Cheers
Hi Jerome!
Thanks, I will give it a try!
Any chance to get this demo updated and converted to Lazarus?
https://sourceforge.net/p/glscene/code/HEAD/tree/branches/Examples/Shaders/GLSL/GLSL_Water/
I cannot manage to get it to compile in Lazarus.
It seems to have all the stuff I'm after, reflective water.
Cheers!
Hi, this demo need some work in code tor be compatible with Lazarus. The best way is to make a child of TGLSLCustomShader like the simple water shader i've done.
You need translate all opengl Command ike glCommandNameb become *GL.CommandName*
After accessing matrix not working like in the original delphi code
Have you try Ocean demo in samples/shader/glsl/ocean ?
Thanks Jerome!
I will try som more to convert it.
Yes, I have used that demo and it helped me with other parts.
In this case I'm interested in reflection on objects on a surface, and using a clipplane to only reflect parts above the surface.
I'm trying to use the FBORenderer for the sampler2D in the shader.
But I cannot make it create the texture while the clipplane is enabled, and then disable the clipplane again.
I will upload a test case when I have one.
Currently I have a hard time making the FBORenderer work at all...
Cheers!
A few lines who generate errors:
gl.LoadMatrixf(@FScene.CurrentBuffer.ModelMatrix); // incompatible types, Matrix4f expected single
FScene.CurrentBuffer.PopModelViewMatrix; // no identified member
gl.LoadMatrixf(FScene.CurrentBuffer.ModelMatrix); // incompatible types, Matrix4f expected single
Any idea what's wrong here?