Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actuale.s.

Posted 28 January 2013 - 10:40 AM

Hello!

 

I have tried to phrase my question in multiple ways, mostly because I don't think I understand the complexity of this particular topic, so thanks for your patience!

 

Yet another rephrase:

1. Can I write Vertex Data to the VertexBuffer for two different objects, (square, triangle), with either the same or different input layout?
2. Can they both use different vertex shaders, pixel shaders, and textures?

3. Could I write a sort of Shader Selector in HLSL that reads a parameter from the input element and dynamically chooses a different pixel shader or texture?

 

Related C++ Code

 

When I create an input layout, can I do this without specifying an actual Vertex Shader, or somehow specify more than one?

 

 

    NS::ThrowIfFailed(
    result = NS::DeviceManager::Device->CreateInputLayout(
    NS::ModelRenderer::InitialElementDescription,
    2,
    vertexShaderFile->Data,
    vertexShaderFile->Length,
    & NS::ModelRenderer::StaticInputLayout
    )
    );


 

When I set the VertexShader and PixelShader, how do I associate them with a particular model in my VertexBuffer?  Is it possible to set more than one of each?



  DeviceManager::DeviceContext->IASetInputLayout(ModelRenderer::StaticInputLayout.Get());

DeviceManager::DeviceContext->VSSetShader(ModelRenderer::StaticVertexShader.Get(), nullptr, 0);
DeviceManager::DeviceContext->PSSetShader(ModelRenderer::StaticPixelShader.Get(), nullptr, 0);

#5e.s.

Posted 28 January 2013 - 10:39 AM

Hello!

 

I have tried to phrase my question in multiple ways, mostly because I don't think I understand the complexity of this particular topic, so thanks for your patience!

 

Yet another rephrase:

1. Can I write Vertex Data to the VertexBuffer for two different objects, (with either the same or different input layout)?
2. Can they both use different vertex shaders, pixel shaders, and textures?

3. Could I write a sort of Shader Selector in HLSL that reads a parameter from the input element and dynamically chooses a different pixel shader or texture?

 

Related C++ Code

 

When I create an input layout, can I do this without specifying an actual Vertex Shader, or somehow specify more than one?

 

 

    NS::ThrowIfFailed(
    result = NS::DeviceManager::Device->CreateInputLayout(
    NS::ModelRenderer::InitialElementDescription,
    2,
    vertexShaderFile->Data,
    vertexShaderFile->Length,
    & NS::ModelRenderer::StaticInputLayout
    )
    );


 

When I set the VertexShader and PixelShader, how do I associate them with a particular model in my VertexBuffer?  Is it possible to set more than one of each?



  DeviceManager::DeviceContext->IASetInputLayout(ModelRenderer::StaticInputLayout.Get());

DeviceManager::DeviceContext->VSSetShader(ModelRenderer::StaticVertexShader.Get(), nullptr, 0);
DeviceManager::DeviceContext->PSSetShader(ModelRenderer::StaticPixelShader.Get(), nullptr, 0);

#4e.s.

Posted 27 January 2013 - 09:50 PM

Hello!

 

I have tried to phrase my question in multiple ways, mostly because I don't think I understand the complexity of this particular topic, so thanks for your patience!

 

I am using the default VertexBuffer essentially as a Static Buffer to hold model templates.  I am using a custom Instance Buffer for instance data.

 

If I have two model templates, (i.e., Square and Triangle), and they both have one pixel shader, and one vertex shader, for their default states, and one pixel shader and one vertex shader for alternate states, (flagged in the instance buffer data), then: 

 

A. How do I "Set" multiple Pixel and Vertex Shaders into the DeviceContext, and how do I tell DirectX to "switch" the Vertex Shader that is loaded at render time? 

 

B. How many Shaders of each type, (Vector, Pixel, Hull, etc), can I associate with model templates in the default Vertex  Buffer?

 

C. Can I use some sort of Shader Selector in HLSL?

 

Related C++ Code

 

p.s., why can't I get my code blocks to stay the right size?

 

When I create an input layout, can I do this without specifying an actual Vertex Shader, or somehow specify more than one?

    NS::ThrowIfFailed(
    result = NS::DeviceManager::Device->CreateInputLayout(
    NS::ModelRenderer::InitialElementDescription,
    2,
    vertexShaderFile->Data,
    vertexShaderFile->Length,
    & NS::ModelRenderer::StaticInputLayout
    )
    );

 

 

 

 

When I set the VertexShader and PixelShader, how do I associate them with a particular model in my VertexBuffer?  Is it possible to set more than one of each?

DeviceManager::DeviceContext->IASetInputLayout(ModelRenderer::StaticInputLayout.Get());

DeviceManager::DeviceContext->VSSetShader(ModelRenderer::StaticVertexShader.Get(), nullptr, 0);
DeviceManager::DeviceContext->PSSetShader(ModelRenderer::StaticPixelShader.Get(), nullptr, 0);




  


#3e.s.

Posted 27 January 2013 - 09:50 PM

Hello!

 

I have tried to phrase my question in multiple ways, mostly because I don't think I understand the complexity of this particular topic, so thanks for your patience!

 

I am using the default VertexBuffer essentially as a Static Buffer to hold model templates.  I am using a custom Instance Buffer for instance data.

 

If I have two model templates, (i.e., Square and Triangle), and they both have one pixel shader, and one vertex shader, for their default states, and one pixel shader and one vertex shader for alternate states, (flagged in the instance buffer data), then: 

 

A. How do I "Set" multiple Pixel and Vertex Shaders into the DeviceContext, and how do I tell DirectX to "switch" the Vertex Shader that is loaded at render time? 

 

B. How many Shaders of each type, (Vector, Pixel, Hull, etc), can I associate with model templates in the default Vertex  Buffer?

 

C. Can I use some sort of Shader Selector in HLSL?

 

Related C++ Code

 

 

 

When I create an input layout, can I do this without specifying an actual Vertex Shader, or somehow specify more than one?

    NS::ThrowIfFailed(
    result = NS::DeviceManager::Device->CreateInputLayout(
    NS::ModelRenderer::InitialElementDescription,
    2,
    vertexShaderFile->Data,
    vertexShaderFile->Length,
    & NS::ModelRenderer::StaticInputLayout
    )
    );

 

 

 

 

When I set the VertexShader and PixelShader, how do I associate them with a particular model in my VertexBuffer?  Is it possible to set more than one of each?

DeviceManager::DeviceContext->IASetInputLayout(ModelRenderer::StaticInputLayout.Get());

DeviceManager::DeviceContext->VSSetShader(ModelRenderer::StaticVertexShader.Get(), nullptr, 0);
DeviceManager::DeviceContext->PSSetShader(ModelRenderer::StaticPixelShader.Get(), nullptr, 0);




  


#2e.s.

Posted 27 January 2013 - 09:49 PM

Hello!

 

I have tried to phrase my question in multiple ways, mostly because I don't think I understand the complexity of this particular topic, so thanks for your patience!

 

I am using the default VertexBuffer essentially as a Static Buffer to hold model templates.  I am using a custom Instance Buffer for instance data.

 

If I have two model templates, (i.e., Square and Triangle), and they both have one pixel shader, and one vertex shader, for their default states, and one pixel shader and one vertex shader for alternate states, (flagged in the instance buffer data), then: 

 

A. How do I "Set" multiple Pixel and Vertex Shaders into the DeviceContext, and how do I tell DirectX to "switch" the Vertex Shader that is loaded at render time? 

 

B. How many Shaders of each type, (Vector, Pixel, Hull, etc), can I associate with model templates in the default Vertex  Buffer?

 

C. Can I use some sort of Shader Selector in HLSL?

 

Related C++ Code

 

 

 

When I create an input layout, can I do this without specifying an actual Vertex Shader, or somehow specify more than one?

    NS::ThrowIfFailed(
    result = NS::DeviceManager::Device->CreateInputLayout(
    NS::ModelRenderer::InitialElementDescription,
    2,
    vertexShaderFile->Data,
    vertexShaderFile->Length,
    & NS::ModelRenderer::StaticInputLayout
    )
    );

 

When I set the VertexShader and PixelShader, how do I associate them with a particular model in my VertexBuffer?  Is it possible to set more than one of each?

DeviceManager::DeviceContext->IASetInputLayout(ModelRenderer::StaticInputLayout.Get());

DeviceManager::DeviceContext->VSSetShader(ModelRenderer::StaticVertexShader.Get(), nullptr, 0);
DeviceManager::DeviceContext->PSSetShader(ModelRenderer::StaticPixelShader.Get(), nullptr, 0);




  


#1e.s.

Posted 27 January 2013 - 09:49 PM

Hello!

 

I have tried to phrase my question in multiple ways, mostly because I don't think I understand the complexity of this particular topic, so thanks for your patience!

 

I am using the default VertexBuffer essentially as a Static Buffer to hold model templates.  I am using a custom Instance Buffer for instance data.

 

If I have two model templates, (i.e., Square and Triangle), and they both have one pixel shader, and one vertex shader, for their default states, and one pixel shader and one vertex shader for alternate states, (flagged in the instance buffer data), then: 

 

A. How do I "Set" multiple Pixel and Vertex Shaders into the DeviceContext, and how do I tell DirectX to "switch" the Vertex Shader that is loaded at render time? 

 

B. How many Shaders of each type, (Vector, Pixel, Hull, etc), can I associate with model templates in the default Vertex  Buffer?

 

C. Can I use some sort of Shader Selector in HLSL?

 

Related C++ Code

 

 

 

When I create an input layout, can I do this without specifying an actual Vertex Shader, or somehow specify more than one?

    NS::ThrowIfFailed(
    result = NS::DeviceManager::Device->CreateInputLayout(
    NS::ModelRenderer::InitialElementDescription,
    2,
    vertexShaderFile->Data,
    vertexShaderFile->Length,
    & NS::ModelRenderer::StaticInputLayout
    )
    );

 

When I set the VertexShader and PixelShader, how do I associate them with a particular model in my VertexBuffer?  Is it possible to set more than one of each?

DeviceManager::DeviceContext->IASetInputLayout(ModelRenderer::StaticInputLayout.Get());

DeviceManager::DeviceContext->VSSetShader(ModelRenderer::StaticVertexShader.Get(), nullptr, 0);
DeviceManager::DeviceContext->PSSetShader(ModelRenderer::StaticPixelShader.Get(), nullptr, 0);




  

 

 

 


PARTNERS