Search found 25 matches

by tomkeus
Mon Jan 25, 2010 11:47 pm
Forum: Advanced Help
Topic: Obtaining VBO and IBO from mesh buffer for OpenGL usage
Replies: 0
Views: 589

Obtaining VBO and IBO from mesh buffer for OpenGL usage

OK, I'm trying to figure out how to do hardware instancing. It was almost impossible to find any usable code for OpenGL on the net, but I've eventually managed to find something. In order to do that, whatever I draw, I need to draw with glDrawElementsInstanced with appropriate VBOs and IBOs set. Now...
by tomkeus
Sat Jan 23, 2010 7:03 pm
Forum: Open Discussion and Dev Announcements
Topic: Irrlicht 1.7 BETA Phase
Replies: 34
Views: 8939

Will there be anything on hardware instancing in 1.7?
by tomkeus
Mon Nov 30, 2009 3:12 pm
Forum: Beginners Help
Topic: Reading/writing z-Buffer
Replies: 20
Views: 1405

It ain't doing the trick. Also, when perspective camera is used, near and far clipping planes settings don't seem to correspond with actual clipping.
by tomkeus
Mon Nov 30, 2009 2:07 pm
Forum: Beginners Help
Topic: Reading/writing z-Buffer
Replies: 20
Views: 1405

Does anyone have anything do say about that weird near/far clipping plane behavior in program I posted?

Is it my code or Irrlicht does something weird internally?
by tomkeus
Sun Nov 29, 2009 2:12 pm
Forum: Beginners Help
Topic: Reading/writing z-Buffer
Replies: 20
Views: 1405

You're doing quite a lot inside the beginScene/endScene part, it's usually better to do things outside the render part I know, but this is just showcasing weird behavior of near/far clipping planes. thout conversion, which won't help much. Simply because teh colors are interpreted as 8bit per color...
by tomkeus
Sun Nov 29, 2009 10:17 am
Forum: Beginners Help
Topic: Reading/writing z-Buffer
Replies: 20
Views: 1405

It should be pretty short. Well, it's abit longer but here it is #include <irrlicht.h> #ifdef _IRR_WINDOWS_ #include <windows.h> #endif #include <gl/GL.h> #include <gl/GLU.h> #include <fstream> using namespace irr; using namespace core; using namespace scene; using namespace video; using namespace ...
by tomkeus
Sat Nov 28, 2009 5:26 pm
Forum: Beginners Help
Topic: Reading/writing z-Buffer
Replies: 20
Views: 1405

Are you sure you're using all the precision that the texture has to offer? If you are using only 8-bit precision then you will obviously encounter problems like this. Search for some functions that pack a floating point value in 4 8-bit integer values for shaders, then do the reverse conversion whe...
by tomkeus
Sat Nov 28, 2009 4:38 pm
Forum: Beginners Help
Topic: Reading/writing z-Buffer
Replies: 20
Views: 1405

Here you go. Test scene contains three planes perpendicular to y axis. One is at y=0, another at y=-5, and one at y=-10. Orthogonal camera is located on y-axis at y=20, looking at origin. Initial near and far values are 15 and 35 respectively. Use Q/W to decrease/increase near value and A/S for far ...
by tomkeus
Fri Nov 27, 2009 6:23 pm
Forum: Beginners Help
Topic: rand()
Replies: 11
Views: 609

Add stdlib.h and time.h and see what happens, although I'm pretty sure Irrlicht included them somewhere for internal use.
by tomkeus
Fri Nov 27, 2009 5:21 pm
Forum: Beginners Help
Topic: rand()
Replies: 11
Views: 609

Seraph wrote:the problem is that the code is inside a do-while. if i write srand outside, it produce ever the same code, if i write srand inside the first value is ever the same, if i write srand inside and outside, the srand inside don't work.
Are you using rand() from C runtime library or some other library?
by tomkeus
Fri Nov 27, 2009 12:09 pm
Forum: Beginners Help
Topic: rand()
Replies: 11
Views: 609

Re: rand()

Seraph wrote:why this function cout<<rand()%1000+300<<endl produce ever the same number?
Because the seed is the same at each call.

Try calling for example

Code: Select all

srand(clock()) 
at application start. This will make sure that each time unique sequence of random numbers is produced.
by tomkeus
Fri Nov 27, 2009 11:34 am
Forum: Beginners Help
Topic: Reading/writing z-Buffer
Replies: 20
Views: 1405

OK, I've just got some problems with positions of near and far clipping planes. I cannot make any sense of them. I know exact positions of geometry in my scene, I set near and far values for camera and get completely nonsensical behavior. For example, I have zNear and zFar for which all of the scene...
by tomkeus
Fri Nov 27, 2009 10:40 am
Forum: Beginners Help
Topic: Reading/writing z-Buffer
Replies: 20
Views: 1405

Couldn't you just setup a shader to render the distance from the camera as color, similar to the depth map used for shadow mapping? Once you can render the depths, it is just a matter of saving the resulting data as an image. Travis That's not bad idea although I'll need to do conversions I'd rathe...
by tomkeus
Thu Nov 26, 2009 1:31 pm
Forum: Beginners Help
Topic: Reading/writing z-Buffer
Replies: 20
Views: 1405

One more question ,when I obtain zBuffer it is on form of floating point values. How do I write them as grayscale image most directly?
by tomkeus
Thu Nov 26, 2009 11:56 am
Forum: Beginners Help
Topic: Reading/writing z-Buffer
Replies: 20
Views: 1405

OK.

glDrawPixels and glReadPixels it is