Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

custom primitive color interpolation

Posted on 2004-04-13
3
Medium Priority
?
409 Views
Last Modified: 2013-12-08
using winXp, VB.NET, VS2003, .NET 1.1, DX9

Currently, using a positioncolorednormal vertex scheme, I color each of the three verticies in a triangle different colors and directX will linearly interpolate those colors.  I would like to specify a different interpolation scheme, say exponential decay or logarithmic.  Is this what a shader language is for, and if so where do I get started.  Also, in order to code the interpolation, I would need access to data not solely in the graphics pipeline, but in the program's classes. Any ideas.
0
Comment
Question by:grknight
  • 2
3 Comments
 
LVL 3

Expert Comment

by:gkatz
ID: 10822551
Shader languages can be used for accomplishing that.  The two languages out there are CG and HLSL.  HLSL is probably what you want since I assume that you are working in directX anyway.  The shaders functions allow you to pass in variables from the outside program but I'm not sure whether it's a good option to pass in a high volume of data from the outside functions.  
0
 

Author Comment

by:grknight
ID: 10823242
What is HLSL (High Level Shader Language?) and where do I get started. Are there any DX9 tutorials on it? Do you have any examples?
0
 
LVL 3

Accepted Solution

by:
gkatz earned 1000 total points
ID: 10835929
HLSL does stand for High Level Shader Language.  It is a part of directX 9.  The only disadvantage to using HLSL (or CG which is HLSL specifically for Nvidia cards) is that you need to have a graphics card that supports using it.  These languages program directly to the video card which means that all processing for these languages occur on the GPU rather than the CPU.  There are many tutorials either on the Microsoft developer site, the ATI site or the NVidia site.  Also most of the newer DirectX 9 books will cover HLSL.  
    The language is not that complex what makes it difficult is understanding that different cards will support different features of the language making it hard to write code that will work on just anyone's pc.  Also the graphics card is broken into two different parts either the pixel shader or the vertex shader.  The pixel shader allows you to apply a HLSL function to each pixel while the vertex shader allows you to apply a HLSL function to each pixel.  These are just functions that are applied to the data as it goes through the graphics pipeline.  

A good starting link is
http://www.ati.com/developer/radeonSDK.html

Also if you have a card that supports HLSL ati's freeware, Rendermonkey is a good developing platform to start from that includes many examples.  It can be downloaded at

http://www.ati.com/developer/sdk/radeonSDK/html/Tools/RenderMonkey.html


hope it helps

gkatz
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses
Course of the Month10 days, 23 hours left to enroll

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question