Solved

custom primitive color interpolation

Posted on 2004-04-13
3
404 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 250 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

635 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