Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: question about vertex shader

  1. #11
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Re: question about vertex shader

    @tpascal: if you try XNA you have a vertex and pixel shader that work at start , just tried it a few days ago.

    This is what XNA gives you as vertex shader:
    Code:
    VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
    {
      VertexShaderOutput output;
    
      float4 worldPosition = mul(input.Position, World);
      float4 viewPosition = mul(worldPosition, View);
      output.Position = mul(viewPosition, Projection);
    
      // TODO: add your vertex shader code here.
    
      return output;
    }
    NecroSOFT - End of line -

  2. #12

    Re: question about vertex shader

    Quote Originally Posted by tpascal
    There is only one thing i dislike About vertex shaders (well, when you are going to use one for first time)...you dont have one working by default; i mean, with the fixed pipeline you already have working functions to apply multiple textures with several blend options, vertex world/view transformations, per vertex lighting with matyerials settings, etc...the basic stuff you need to render thousand triangles textured and lightened; but if you say "humm, i would like to add a wave effect...i am going to write a shader for that..." forget it, beside the wave effect you also have to code your self in the shader any function you was using from the fixed pipeline, you cant combine boths, when you switch to shaders, you have to code everithing needed for render a vertex: transformations, textures, blending effects, colors, lighting maths, etc.

    Beside that, once you have one basic vertex shader coded and working for doing basic stuff, then you will want to do everithing in shaders, and none in cpu,

    I'm actually pretty sure there's an instruction which can make it do that(in GLSL)
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #13
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Re: question about vertex shader

    Not sure, but I recall reading something about it... at microsoft site... (in HLSL)
    NecroSOFT - End of line -

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •