Jump to content

  • Log In with Google      Sign In   
  • Create Account

OzgurEra

Member Since 22 Jun 2012
Offline Last Active Feb 05 2016 01:37 PM

Topics I've Started

Nvidia and Bindless Texture

17 August 2015 - 03:27 PM

Does anyone know what is the minimum model for a nVidia graphics card to support Bindless Textures?

I have a nVidia 820m graphics card on my laptop, supports OpenGL 4.5 Core, and it seems like it does not support bindless textures. 
 

 

glxinfo | grep "bindless"
only returns the following two:
- GL_NV_bindless_multi_draw_indirect, 
- GL_NV_bindless_multi_draw_indirect_count
 
I also checked using GLEW_NV_bindless_texture and GLEW_ARB_bindless_texture, they both returned false.
 
Its quite surprising that my card supports most of the "modern" extensions but not bindless textures.

[SOLVED] [GLSL] Weird behavior with interface blocks.

03 February 2015 - 05:36 PM

Hello friends!

I have a strange behaviour with my glsl code..

I am trying to pass a simple 'uint' variable between stages (from vertex shader to fragment shader), but it seems like I'm doing something wrong.

I have an interface block like this:

// Vertex Shader
out InterfBlock {
	vec4 WorldPos;
	vec3 WorldNormal;
	vec2 TexCoord[2];
	vec3 CamDir;
 	uint DrawID;
} OUT;	

//Fragment Shader
in InterfBlock {
	vec4 WorldPos;
	vec3 WorldNormal;
	vec2 TexCoord[2];
	vec3 CamDir;
	uint DrawID; // This line is the problem, works if I remove.
} IN;

When I run my program, it simply generates no error.
(There is an error checker already that uses glGetShaderInfoLog() and works when I simply forget to put a semicolon, so I know it works,)

But also my GpuProgram class gives me the number of Uniforms in my shaders. But it says 0 (zero). (But there are a few uniforms)

The strange thing is, the shader works perfectly when I simply remove the "uint DrawID;" from FRAGMENT SHADER.. (Also shows the correct amount of Uniforms if I remove).

It doesn't matter if I keep it in Vertex Shader, it works. But when I add the line "uint DrawID;" in interface block of frag shader, It stops working.
Any ideas?

 

Edit:
NVIDIA Driver Version: 331.113
OS: Linux-x86_64

OpenGL version from glxinfo: 3.3.0 NVIDIA 331.113


glMultiDrawElements with Transformation matrices

16 August 2014 - 04:14 PM

Hello guys,
I have a problem with using glMultiDrawElements;

In a typical drawing, I would do something like this: (Pseudo-code)

 

foreach obj in objects {
    SetOtherStuffs();

    

    SetModelMatrix(...);

    glDrawElements(...);

}

 

As you can see, I can set Model Matrices of every model.
But with glMultiDrawElements, How can I achive something like this? How can I give a different matrix for every object?
Is there a shader counter for draw calls? (So I can grab their matrices from something like a uniform.)

If yes. How will this counter increased if some of the calls are instanced when I use glMultiDrawElementsIndirect()?


Vertex Buffers in OpenGL

19 January 2013 - 05:26 PM

Actually, It's not an OpenGL question.

This is how I draw things in OpenGL:

glEnableClientState (GL_VERTEX_ARRAY);	
glEnableClientState (GL_NORMAL_ARRAY);	
glEnableClientState (GL_TEXTURE_COORD_ARRAY);		
glVertexPointer(3, GL_FLOAT, sizeof(VertexBuffer), obj->m_vertices[0].vertex);	
glTexCoordPointer(2, GL_FLOAT, sizeof(VertexBuffer), obj->m_vertices[0].texCoord);	
glNormalPointer(GL_FLOAT, sizeof(VertexBuffer), obj->m_vertices[0].normal);			
glDrawElements (GL_TRIANGLES, obj->indicesCount, GL_UNSIGNED_INT, obj->indices);					glDisableClientState (GL_VERTEX_ARRAY);	
glDisableClientState (GL_NORMAL_ARRAY);	
glDisableClientState (GL_TEXTURE_COORD_ARRAY);



As you see here, I don't use any memcpy..

And this is how I have to draw in DirectX: (Pseudo)

D3DVERTEX *ptr = NULL;
app.getDevice()->CreateVertexBuffer(sizeof(quad),                                    
D3DUSAGE_WRITEONLY,                                    
0,                                    
D3DPOOL_MANAGED,                                    
&vertex_buffer,                                    
NULL);
vertex_buffer->Lock(0, 0, (void**)&ptr, 0);
memcpy((void*)ptr, (void*)vetices_of_quad, sizeof(vetices_of_quad));
vertex_buffer->Unlock();




As you see here, I have to use a "memcpy" each frame.. Why each frame, because I can't keep my LPDIRECT3DVERTEXBUFFER9 object..

I just want to hold my vertex data in my own vertex buffer class (VertexBuffer), and be able to use it in both OpenGL and DirectX, without copying the data each frame..

I don't know DirectX much.. I'm a newbie.
Please help sad.png

(BTW, sorry for my bad English)


UDP Clients

07 December 2012 - 05:45 PM

First of all sorry for my bad English..

I have a question about UDP sockets..

I have used TCP lots of times, and when I need to create a multi-client server, I create a Client class, and call a Receive function which calls "recv" using its socket number.. So I can easily read data that related to this client from socket..

But now, I want to use UDP..
in UDP, there is no socket numbers as in TCP.. I use recvfrom and it gives me a address.. How can I bind an address to a Client (a pointer)..
When a data received, how can I know whose data is this?

Do I have to create a table like hashtable? Or is there any methods that commonly used to handle hundreds of client ?

PARTNERS