This is a small example of how to use a framebuffer object (sometimes the output is called a render target, although that's more of a DirectX term) in OpenTK. There's a second camera in the scene with its position indicated by the arrow. What that camera sees is put into a texture and then displayed on a model of a TV.
This is also significant because it allows us to get the depth information of the scene. This allows us to create shadows later by easily determining if there is an object closer to the light (which would have a camera "seeing" from its direction above or in the scene), and darkening parts where that is true.
Controls:
- WASDQE - Move main camera
- UHJK - Move texture camera
- C - Switch between color view and depth view
- V - Toggle TV static shader on/off
Hi !
ReplyDeleteI'm learning opentk in c#m do you have good document for this.
Thanks !
You actually make it appear really easy along with your presentation however I to find this
ReplyDeletetopic to be actually one thing that I feel I would never understand.
It kind of feels too complex and very vast for me. I am taking a look forward in your subsequent submit,
I will try to get the cling of it!
Ciao, ma sei italiano?
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteHello, I have got error like obj makes unendless and it crashes sometimes. Please fix it!
ReplyDeleteI am using Visual Studio 2017 Community and OpenTK 3.00 preview or 2.00 stable. Thanks!
And I show you like it happens
DeleteCheck screenshot:
https://i.imgur.com/Kqt1JxM.png