Skip to main content
GameDev.net gamedev.net
🔒 Locked

Shader ...time value!

Started by rupeshmandke Jan 8, 2007 at 1:12 AM 4 replies 1k views
Original Post
rupeshmandke
rupeshmandke
i want to give my time value from c++ application to shader program written in HLSL ... how can i go abt it??? my take on this is ... i can store time value from c++ program into constant register ...then assign tht register value to some variable in shader program n access... but here my confusion is ....since time value will b cont. advancing...will it b iterated in constant register as well ... am not sure about this ... but i think i need to do this manually ... :) can any1 put some light on this issue??? if at all i need to change values in registers manually ...how to go abt it?? thx in advance! :)
moagstar
moagstar
Just pass the value as a constant, don't worry about the time being exactly accurate for each pixel / vert that is processed, the amount of time passed between the processing is miniscule.
Drazgal
Drazgal
You should be taking the current time at the start of each game frame and using that value for all time calculations in that frame. Taking a constantly updating time value throughout a frame will only lead to problems.
Sneftel
Sneftel
This is more appropriate for the DirectX forum.
rupeshmandke
rupeshmandke
got it folks ...
am wrking on it ..
cheers!
rupeshmandke
rupeshmandke
got it folks ...
am wrking on it ..
cheers!

Topic Locked

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

Sign in to reply to this topic.