Jump to content

  • Log In with Google      Sign In   
  • Create Account


Drakken255

Member Since 14 Oct 2010
Offline Last Active Aug 18 2013 04:44 PM
-----

Posts I've Made

In Topic: Optimizing Instancing Shader (Reducing Transfer Volume)

15 August 2013 - 10:36 PM

Many thanks, can I get an example in the shader? I can't seem to get it working. Also, translations are held in the bottom row of matrices, yes? Because I build each instance's translation matrix like so:

float4x4 instanceTrans = {1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
trans[0], trans[1], trans[2], 1};

and when I multiply that with my rotations, things get weird. But if I don't, then the faces face up as expected.

In Topic: Optimizing Instancing Shader (Reducing Transfer Volume)

15 August 2013 - 06:15 PM

Thanks for the tip, but I decided to simply build and pass 6 rotation matices to the shader before even sending the instances, since a cube face can only have 6 rotations. So now it's just a matter of correctly reducing the size of my atlas index information. Should I be able to apply a similar technique since my atlas indices are unsigned shorts? Even if I have to pack 2 shorts into one 32 bit integer, and unpack them to 2 32 bit unsigned ints in the shader, that's fine. I just don't know what combination of options will allow me to correctly send 4 unsigned shorts.

In Topic: Optimizing Instancing Shader (Reducing Transfer Volume)

14 August 2013 - 07:57 PM

Let it be known that all I'm asking is how to write my shader and other relavent graphics code to send as little data per-instance as possible. I'll worry about reducing instances on my own.

 

That being said, I need to know how to send four (4) unsigned short integers to the GPU, considering HLSL has no 16 bit integer type.


In Topic: Optimizing Instancing Shader (Reducing Transfer Volume)

14 August 2013 - 08:11 AM

Firstly, if this ever becomes more than a learning exercise, it will definitely not be a Minecraft clone. It will instead likely be a 3D Pocket Tanks.

I am already instancing individual faces, and my game detects whether a face is hidden by others. So it is only drawing what can be seen, except for faces behind others. I haven't quite figured out occlusion culling yet, but that is a secondary concern.

The entire purpose of my post was to ask how to effectively reduce graphics transfer bandwidth on a per-instance basis first, and then reduce the number of instances.

EDIT: I figured out how to reconstruct translation and rotation matrices, so all I need to pass per-instance is 3 floats for position, and 3 floats for rotation. Now, it's just a matter of whether or not a ushort will be properly converted to a regular int by the shader.

In Topic: [XNA] Model Renders Black

21 October 2012 - 04:06 PM

Lost contact with the user above. Thus, I still am looking for someone to do this.

PARTNERS