Hi, im trying to learn shadows and im trying my hand at shadow mapping. Now i know this is not ideal but im not using C++ im using lua and unfortunatly the current lua library im using doesnt support Gentextures. So therfore i cant gen a texture to write depth buffer data to.
Is there a way i can store the depth buffer data somwhere else to use? Such as an array or a buffer? I can genbuffers?
I have never used Lua, but (like in every other language) it should be possible to call C functions from it.
You can write simple ‘wrapper’ library in C (which contains calls to whatever You need).
Now i know this is not ideal but im not using C++ im using lua and unfortunatly the current lua library im using doesnt support Gentextures. So therfore i cant gen a texture to write depth buffer data to.
Um, if your Lua library doesn’t expose something as simple as glGenTextures, you need to find a better Lua OpenGL library.
ok, without sounding arsey, but im not upto scratch in C++ so im learning openGL using lua, so… do you have an answer to my reasnoble question or are you just going try and mock everything i say?
Oh and just to add, it uses luaGL but has expanded this to cover most of the OpenGL specification through 2.0.
ok, without sounding arsey, but im not upto scratch in C++ so im learning openGL using lua, so… do you have an answer to my reasnoble question or are you just going try and mock everything i say?
I’m not mocking what you’re saying. I’m pointing out that you’re using an old, antiquated tool. It is clearly missing vital functionality, like glGenTextures and apparently glTexSubImage.
This is simply not a good tool to use for OpenGL development. It would be great if it was, but it simply is not.
Why is it that you cannot save your depth-map to a texture? Does it give an error? What error? Are you able to read depth values at all? Are you using shaders?
If you let us know a bit about what you are trying to do, perhaps we could help better.
Ok, im trying to do shadows, dont want to do planar shadows, so i thought ide have a go at shadow mapping or stencil shadow volumes. Both i belive neeed to save the depth buffer data to a texture?
Anyway, i have been trying to do shadow mapping method, which as im sure you know, requires one pass to read the depth buffer to a texture? I apparently cannot do that, it would work so i enquired about why and got told it unfortunatly isnt working but he hopes to get it working. So…as i have done quite alot of work so far using lua and openGL i dont want to move away from it quite yet, so i wondered if there is another way of read the depth buffer to somwhere and as apposed to a texture in memory?
This is currently all being done in the standard pipeline. I have basic knowldge of shaders by which i mean, from what ive learnt on the forums, so per pixel lights ETC.
But as far as i know, the ay to do the same shadow mapping using shaders still requires the depth buffer to be saved to a texture to pass to the shader? So i dont think shaders can over come the problem, unless you kind knowledgable people know how and would like to explain