Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8885357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:17:25+00:00 2026-06-14T21:17:25+00:00

Im working with model instancing in XNA 4.0 and I sending my model instance

  • 0

Im working with model instancing in XNA 4.0 and I sending my model instance transformation in a parallel stream. Im following this tutorial. However when I want a matrix as input to my shader I get what looks like a damaged matrix, because I get strange projection results.

Does anyone know the source to the problem and why I can’t pass the matrix when others suggest so?

Problem:

struct VertexShaderInput
{
    float4 Position : POSITION0;    
    float3 Normal : NORMAL0;
    float3 UV : TEXCOORD0;
    float3 Color : COLOR0;
    float3 Tangent : TANGENT0;
    float3 Binormal : BINORMAL0;
    float4x4 World : TEXCOORD3; //Problem 
};

Changing the vertex shader function to the following does not help either:

VertexShaderOutput VertexShaderFunction(VertexShaderInput input, float4x4 World : TEXCOORD3)
{

}

This works if I build the matrix with the vectors alone, I dont know why. Im I losing data?

struct VertexShaderInput
{
    float4 Position : POSITION0;    
    float3 Normal : NORMAL0;
    float3 UV : TEXCOORD0;
    float3 Color : COLOR0;
    float3 Tangent : TANGENT0;
    float3 Binormal : BINORMAL0;
    float4 World1 : TEXCOORD3;
    float4 World2 : TEXCOORD4;
    float4 World3 : TEXCOORD5;
    float4 World4 : TEXCOORD6;
};

Vertex format:

internal struct InstanceDataVertex   
{
        public Matrix World;

        public InstanceDataVertex(Matrix World)
        {
            this.World = World;
        }

        public readonly static VertexDeclaration VertexDeclaration = new VertexDeclaration
        (
            new VertexElement(0, VertexElementFormat.Vector4, VertexElementUsage.TextureCoordinate, 3),
            new VertexElement(sizeof(float) * 4, VertexElementFormat.Vector4, VertexElementUsage.TextureCoordinate, 4),
            new VertexElement(sizeof(float) * 8, VertexElementFormat.Vector4, VertexElementUsage.TextureCoordinate, 5),
            new VertexElement(sizeof(float) * 12, VertexElementFormat.Vector4, VertexElementUsage.TextureCoordinate, 6)
        );
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:17:26+00:00Added an answer on June 14, 2026 at 9:17 pm

    The input registers on the GPU are limited in size. The size of TEXCOORDn is float4 (as listed here). There are no float4x4 inputs.

    Splitting your matrix across several input registers and then reconstructing it should work fine. It’s just a matter of making sure the right values in your C# Matrix end up in the right places in your HLSL float4x4. I suspect the mapping is trivial, but I’m not sure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working in a symfony model, I want to override a function and call the
I am working with a Django model that looks like this: class Subscription(models.Model): user
I'm following this tutorial , but it fails when I try to push to
Suppose I have this simple app working : # model class Project has_many :numbers
I am working in a model-driven environment, where Java code is generated from a
I'm working with a small model in Entity Framework 4.0. I'd like to have
I am working on a database model that will hold meta data about a
I'm working with an existing EF data model that includes subclassed objects. That works
I am working with the output from a model in which there are parameter
I'm working on a data model for SIP routing information. Let's take as example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.