Solved

custom primitive color interpolation

Posted on 2004-04-13
3
393 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now