Solved

custom primitive color interpolation

Posted on 2004-04-13
3
403 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

752 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