Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

shader question

Started by derek7 1 reply 300+ views
Original Post
derek7
derek7
1. If I write a simple vs, so the transform and light in fixed pipeling will be replace by vs in spite of my vs is simple or complex?? 2. many HLSL language built-in function all are run on GPU??
Armadon
Armadon
To understand why and what is replaced you must know what you are doing...
When you are writing/coding a vertex shader you are replacing your transform and lighting stage and this means that you will disable that part of the fixed function pipeline.

The Transform and Lighting stage looks like this
World Transform : Objects are placed in the world
View Transform : Objects are relocated around the camera and the camera is the center of the world.
Lighting : Lighting gets applied to the objects (lighting calculations gets done)
Projection Transform : The View frustum is clipped into a cubiod to give the effect of projection.
This means that you are able to replace all these "models" by your own model such as calculating the light differently such as creating detailed effects like normal mapping (bump mapping technique) and so forth.

I hope this helps.
Take care.
derek7
derek7

2. many HLSL language built-in function all are run on GPU??

I know D3DX lib (math lib etc..)are all run on cpu.
HLSL built-in function like (like abs, cos, ...seem to better run on cpu ) all run GPU?




Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.