Jump to content

  • Log In with Google      Sign In   
  • Create Account

rgc183

Member Since 12 Dec 2012
Offline Last Active Oct 05 2014 11:23 PM

Topics I've Started

Storage of texture and framebuffer attachement

23 September 2014 - 12:26 AM

  1. Texture Data: When we call glTexImage() it uploads data on GPU, in which memory (EDRAM or shared memory for Streamline processors) this data is stored? When we call glGenerateMipmap() does it create mipmap levels in GPU memory or CPU creats levels and uploads them on GPU? While sampling all texture data is sampled in Texture filering unit in GPU, right? All these units are shared between all the streamline processors or each processor has one separate?

  2. Framebuffer data: Where are attachments of FBO are stored? Are they stored in main memory from EDRAM?

  3. While doing all fragment tests, where is this data compared from, is it from main memory? or is that the data is cached into EDRAM?


camera movement in particle system

29 July 2014 - 02:27 PM

I am rendering particles using billboard technique but when i move the camera towards left, orientation of quad changes and they disappears when camera continued to move towards left. here is my GS, my vertex shader is pass through shader.

float3 pos=gin[0].Position.xyz;

float3 cameraV=normalize(EyePosition.xyz - pos );
float3 up= float3(0.0, 1.0, 0.0);

float3 right= normalize(cross(up,cameraV))*0.025 ;
up=cross(cameraV,right);

gout.position=float4(pos - (right + up),1.0);
gout.TexCord = float2(0.0, 0.0);
triStream.Append(gout);

gout.position=float4(pos + (right- up),1.0);
gout.TexCord = float2(0.0, 1.0);
triStream.Append(gout);

gout.position=float4(pos- (right - up),1.0);
gout.TexCord = float2(1.0, 0.0);
triStream.Append(gout);

gout.position=float4(pos + (right+ up),1.0);
gout.TexCord = float2(1.0, 1.0);
triStream.Append(gout);
triStream.RestartStrip();

 

settings for culling

 

CullMode = D3D11_CULL_BACK;

FrontCounterClockwise = FALSE;


particle system with stream output not working

24 July 2014 - 02:00 PM

I am working on particle system using DX11 stream output. But there are some issues with it and not working as expected. Here are the steps I am following.
 
Technique 1: to update stream buffer
1. Create vertex and pixel shader using CreateShader() call. Set pixel shader to null. 
2. create geometry shader using: 
 
    D3D11_SO_DECLARATION_ENTRY pDecl[] =
    {
        
        { 0, "SV_POSITION", 0, 0, 4, 0 },   
        { 0, "VELOCITY", 0, 0, 3, 0 },     
        { 0, "AGE", 0, 0, 1, 0 },    
    { 0, "TYPE", 0, 0, 1, 0 }
    };  
       
       hr=pD3dDevice->CreateGeometryShaderWithStreamOutput(blob->GetBufferPointer(), blob->GetBufferSize(),pDecl, sizeof(pDecl)/sizeof(D3D11_SO_DECLARATION_ENTRY),NULL,0,0,NULL,&GeometryShader);
 
3. Create two buffers with flags: `D3D11_BIND_VERTEX_BUFFER | D3D11_BIND_STREAM_OUTPUT` .
 
technique 2: to render particles
1. compile the shaders using createshader call. 
 
Render:
 
1. set pixel shader to NULL and disable rasterization using `OMSetDepthStencilState`. 
2. update one of the buffers by generating particles in geometry shader.
3. Set both buffer targets to NULL.
4. Use the above buffer to render particles.
5. Set both buffer targets to NULL.
6. swap the buffers.
 
The problem is that something going wrong while reading from stream buffers. Both the techniques when run individually, works fine and gives correct output but problem arises when stream buffer comes into the picture. 
Is there anything i am missing?

particle system with stream output not working

23 July 2014 - 12:27 PM

I am working on particle system using DX11 stream output. But there are some issues with it and not working as expected. Here are the steps I am following.
 
Technique 1: to update stream buffer
1. Create vertex and pixel shader using CreateShader() call. Set pixel shader to null. 
2. create geometry shader using: 
 
      D3D11_SO_DECLARATION_ENTRY pDecl[] =
    {
        // semantic name, semantic index, start component, component count, output slot
        { 0, "SV_POSITION", 0, 0, 4, 0 },   // output all components of position
        { 0, "VELOCITY", 0, 0, 3, 0 },     // output the first 3 of the normal
        { 0, "AGE", 0, 0, 1, 0 },     // output the first 2 texture coordinates
     { 0, "TYPE", 0, 0, 1, 0 }
    };  
       
       hr=pD3dDevice->CreateGeometryShaderWithStreamOutput(blob->GetBufferPointer(), blob->GetBufferSize(),pDecl, sizeof(pDecl)/sizeof(D3D11_SO_DECLARATION_ENTRY),NULL,0,0,NULL,&GeometryShader);
here the pointers are of geometry shader code.
 

3. Create two buffers with flags: `D3D11_BIND_VERTEX_BUFFER | D3D11_BIND_STREAM_OUTPUT` .
 
technique 2: to render particles
1. compile the shaders using createshader call. 
 
Render:
 
1. set pixel shader to NULL and disable rasterization using `OMSetDepthStencilState`. 
2. update one of the buffers by generating particles in geometry shader.
3. Set both buffer targets to NULL.
4. Use the above buffer to render particles.
5. Set both buffer targets to NULL.
6. swap the buffers.
 
Is there anything i am missing?

rotating objects in a double orbit

10 September 2013 - 06:02 PM

I have a object at the center. Other set of objects rotating around center in first orbit. Now i want other objects to rotate around the objects in 1st orbit.

 

n the above fig, set of triangles are rotating around the square and circles are rotating around the triangle. I have the code which works for 1st orbit, but i am not able to render that second orbit.

void display()
{
for (int k = 0; k < 10; k++)
{

distance_x = 0.4 * cos(angle1*3.14 / 180);
distance_y = 0.4 * sin(angle1*3.14 / 180);
angle1 += 60;
glPushMatrix();
glRotatef(i, 0.0f, 0.0f, 1.0f);
glTranslatef(distance_x, distance_y, 0.0f);
glRotatef(-i, 0.0f, 0.0f, 1.0f);

DrawTriangle();
glPopMatrix();
}
}
 

I am calling display in loop. i is static global variable. which transformations will do the second orbit?


PARTNERS