Thread: how to change width of a Vertex shader??

  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    4

    how to change width of a Vertex shader??

    Hi im trying to change the width of a Vertex shader it deals with the overlay intel rings the thickness is to much i would like to half the size of them, any help would be great thanks
    code is bellow there is more to the file if its needed
    Code:
    //////////////////////////////////////////////////////////////////////////////
    // Vertex shader
    
    RangeVS_OUTPUT RangeVS(
    #ifndef XBOX
        RangeVS_INPUT In
    #else
        int index : INDEX
    #endif
    )
    {
    #ifdef XBOX
        RangeVS_INPUT In		= CreateRangeVertexInput( index );
    #endif 
    
    	// Output from vertex shader
    	RangeVS_OUTPUT Out		= (RangeVS_OUTPUT)0;
    	
    	// Scale the vertex based on requested range, and add in the instanced position
    #if FEATHER_OUT
    	In.Vertex.xy			*= dot( In.AlphaScalar.yz, float2( In.Radius.y, In.Radius.y + FogIntel.z ) );
    #endif
    #if FEATHER_IN
    	In.Vertex.xy			*= dot( In.AlphaScalar.yz, float2( max( 0.0f, In.Radius.y - FogIntel.z ), In.Radius.y ) );
    #endif
    	In.Vertex.xy			+= In.Position.xy - 1;
    	
    	// Scale the values by the map dimensions and then map to [-1,1]
    	In.Vertex.xy			*= FogIntel.xy;
    	In.Vertex.xy			= In.Vertex.xy * 2 - 1;
    		
    	// Transform vertex to homogenous clip space
    	Out.Position			= float4( In.Vertex.x, -In.Vertex.y, 1.0f, 1.0f );
    #if FEATHER_OUT
    	Out.Color				= In.AlphaScalar.xxxx;
    #endif
    #if FEATHER_IN
    	Out.Color				= float4( 1.0f, 1.0f, 1.0f, 1.0f ) - In.AlphaScalar.xxxx;
    #endif
    	
    	// Return our finished product
    	return Out;
    }
    
    
    //////////////////////////////////////////////////////////////////////////////

  2. #2
    Registered User
    Join Date
    Mar 2010
    Posts
    68

    restate

    well, just divide the position by two before you transform it into viewprojection space.


    Remember, the ordering of matrix is typically: Scaling*Rotation*Translation*View*Projection

    So, add the scaling first, then do what ever else you want to do.
    Last edited by smasherprog; 12-03-2010 at 03:17 AM.

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    4
    Quote Originally Posted by smasherprog View Post
    well, just divide the position by two before you transform it into viewprojection space.


    Remember, the ordering of matrix is typically: Scaling*Rotation*Translation*View*Projection

    So, add the scaling first, then do what ever else you want to do.
    would you mind showing me how i don't really under stand how shaders work? if you could scale it by 0.5 that would be great thanks,
    Last edited by lukeJ; 12-03-2010 at 10:25 AM.

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    If you do not understand vertex shaders then my guess is you should not be messing around in them yet. Read some books about vertex and pixel shaders and then you might be able to move forward. There are also many sites on the internet that talk about vertex and pixel shaders. The DirectX SDK docs illustrate where in the pipeline vertex and pixel shaders are used and how they fit into the overall model.

  5. #5
    Registered User
    Join Date
    Dec 2010
    Posts
    4
    Quote Originally Posted by Bubba View Post
    If you do not understand vertex shaders then my guess is you should not be messing around in them yet. Read some books about vertex and pixel shaders and then you might be able to move forward. There are also many sites on the internet that talk about vertex and pixel shaders. The DirectX SDK docs illustrate where in the pipeline vertex and pixel shaders are used and how they fit into the overall model.
    thanks but im not looking to learn about vertex shaders at the moment im learning lua this is for a mod for a game i made people using my mod wanted the radius rings cut in half in thinness so if some one could make the changes needed i would be much appreciated

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    thanks but im not looking to learn about vertex shaders at the moment im learning lua this is for a mod for a game i made people using my mod wanted the radius rings cut in half in thinness so if some one could make the changes needed i would be much appreciated
    That's not how things work around here. We don't do any work for people. This site is intended to help people which sort of means they want to help themselves. We do not spit out code solutions or fix people's code here.

    Unless you show some effort I will close this thread.

  7. #7
    Registered User
    Join Date
    Dec 2010
    Posts
    4
    Quote Originally Posted by Bubba View Post
    That's not how things work around here. We don't do any work for people. This site is intended to help people which sort of means they want to help themselves. We do not spit out code solutions or fix people's code here.

    Unless you show some effort I will close this thread.
    i see how it works dont worry then and delete my account good by.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ChangeDisplaySettings - Blank?
    By Tonto in forum Windows Programming
    Replies: 13
    Last Post: 12-26-2006, 04:17 PM
  2. FAQ: Graphics Math
    By crepincdotcom in forum FAQ Board
    Replies: 23
    Last Post: 10-04-2004, 12:03 PM
  3. Display list not displaying?
    By psychopath in forum Game Programming
    Replies: 5
    Last Post: 09-19-2004, 06:47 PM
  4. StringGrids and how to change column width???
    By cmangel518 in forum C++ Programming
    Replies: 2
    Last Post: 04-18-2002, 10:59 AM
  5. Replies: 2
    Last Post: 09-04-2001, 02:12 PM

Tags for this Thread