• Advertisement

Archived

This topic is now archived and is closed to further replies.

Fragment Programs -- How to get them to load

This topic is 5095 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Although I am not new to programming or graphics programming, I am new to Cg, so this forum is the best place for this question. I wrote a Cg program to implement my FFT water with heightmap, normalmap and fragment reflection via lookups on environmentmaps. I cannot seem to get this program to load, however! After this line: cg_clouds = cgCreateProgramFromFile(shaderContext, CG_SOURCE, "cg_clouds.cg", FPProfile, NULL, NULL); cg_clouds still equals 0 and i do not know why. Perhaps you could give a tutorial on all the steps of initializing a fragment program since I must be leaving out something. --===LITHIC===-- --===WWW.Decimation.TK===--

Share this post


Link to post
Share on other sites
Advertisement
I''m not too familiar with the cg API, but shouldn''t the argument after FPProfile be the name of the entry point? Also does the function returning a 0 actually signify an error? It could be that it''s the first program loaded and hence it gets the first handle number.

Share this post


Link to post
Share on other sites
All the code i''ve looked at just leaves the last two parts as NULL or 0, so I did as well. I think what I may be doing wrong has something to do with the path since i create the context and find which profile they''re using. It does mean that it is not working when cg_clouds = 0, since cg_clouds should be a pointer to to the location in memory of the Fragment Program.

Share this post


Link to post
Share on other sites
I found a Cg function that gets the error. Its with my fragment program code, not the initialization. Thanks anyways!

--===LITHIC===--
--===WWW.Decimation.TK===--

Share this post


Link to post
Share on other sites

  • Advertisement