• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About quaikohc

  • Rank

Personal Information

  • Interests
  1. I am accumulating u: verts[ currVertIndex ].uv.X = outVerts[ currVertIndex - 1 ].uv.X + dist;
  2. I believe I am doing that: pos and prevPos in my code are the points on the spline ( center of the road ).
  3. Hi, Im working on a procedural road system and I use bezier splines to genereate the mesh ( tri strip ) but I have a problem with calculating proper uv coordinates. The texture looks distorted on curved segments like on the attached picture When calculating uv i first init them to ( 0.0f, 0.0f ) or ( 0.0f, 1.0f ) for each vertex, and then add the distance between current and previous point on a curve to the previous vert U coord ( V stays the same ). Something like this: float dist = ( pos - prevPos ).Magnitude(); float lenScale = roadWidth / m_uvStretch; dist /= lenScale; verts[ currVertIndex ].uv.X = outVerts[ currVertIndex - 1 ].uv.X + dist; What am I missing? Thanks
  4. physx is under very active development, so it's not dead
  5. xna 4 hardware instancing

    sry,. nvm, it was my fault, i created two vertex buffers for instancing with the same vertex declaration
  6. hi can you explain me in what order data from my instanced vertex is passed to the shader, and why? this is my vertex declaration for instanced models: [color=#4A4A4A] [StructLayout(LayoutKind.Sequential)][/color] [color=#4A4A4A] public struct PointLightDataVertex[/color] [color=#4A4A4A] {[/color] [color=#4A4A4A] public Vector4 LightPosAndRadius;[/color] [color=#4A4A4A] public Vector4 LightColorAndFallof;[/color] [color=#4A4A4A] public PointLightDataVertex(Vector4 a, Vector4 b)[/color] [color=#4A4A4A] {[/color] [color=#4A4A4A] LightPosAndRadius = a;[/color] [color=#4A4A4A] LightColorAndFallof = b;[/color] [color=#4A4A4A] }[/color] [color=#4A4A4A] public readonly static VertexDeclaration VertexDeclaration = new VertexDeclaration([/color] [color=#4A4A4A] new VertexElement(0, VertexElementFormat.Vector4, VertexElementUsage.TextureCoordinate, 5),[/color] [color=#4A4A4A] new VertexElement(sizeof(float) * 4, VertexElementFormat.Vector4, VertexElementUsage.TextureCoordinate, 6));[/color] [color=#4A4A4A] }[/color] and this is how i initialize them: [color=#4A4A4A] (...) PointLightDataVertex(new Vector4(123.0f, 124.0f, 125.0f, 126.0f), new Vector4(3.0f, 4.0f, 5.0f, 6.0f));[/color] [color=#4A4A4A]struct VSIn[/color] [color=#4A4A4A]{[/color] [color=#4A4A4A] float4 Position : POSITION0; [/color] [color=#4A4A4A] // per instance[/color] [color=#4A4A4A] float4 LightPosAndRadius : TEXCOORD5; [/color] [color=#4A4A4A] float4 LightColor : TEXCOORD6;[/color] [color=#4A4A4A]};[/color] [color=#4A4A4A]what i get in vertex shader (checked with pix) :[/color] [color=#4A4A4A]LightPosAndRadius (125.000, 126.000, 3.000, 4.000) [/color] [color=#4A4A4A]LightColor (5.000, 6.000, 123.000, 124.000) [/color] [color=#4A4A4A]why the order is so strange?[/color]
  7. [quote name='Hodgman' timestamp='1323225562' post='4891322'] In simple terms, you can think of the "[i]specular[/i]" value as being the same as a "[i]spec mask[/i]" or "[i]IOR[/i]", and you can think of the "[i]smoothness[/i]" as being equivalent to "[i]spec power[/i]" or "[i]roughness[/i]". [/quote] but isn't specular power usually stored in 8 bits? why they needed whole render target to store this ? Przemek
  8. hi i'm working on my own md5loader and i have problem, my model looks like this (cut on z axis - it displays only half of a mesh): what is the possible reason of this? i know it's probably stupid, but im trying to fix this for few hours and i still don't know what is wrong TIA
  • Advertisement