Solved

custom primitive color interpolation

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best Golf game for PC running Windows 1 769
Sudoku - eraseable white board 2 298
PDF: Display my cards game? 8 135
Any Fantasy Football Brute force AI suggestions? 2 81
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…
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

756 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