Jump to content
  • Advertisement
Sign in to follow this  
Hydrael

Possible to realize in Rendermonkey? (GPU Gems 2 required)

This topic is 4834 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

Hello everyone, can anyone tell, if it is possible to realize chapter 16 of GPU Gems 2 (source including GLSL shaders can be downloaded here) within ATI's Rendermonkey? I've been trying around a bit to do so, but all of those precalculated uniforms (camera magnitude, light vector, etc) make things pretty hard in my eyes. Is there any way at all to precalculate values in Rendermonkey, or would I have to do that within the shader itself by modifying it? Thanks in advance Chris

Share this post


Link to post
Share on other sites
Advertisement
I dont know if I understand what you mean by precalculate here, but you can set uniforms easily in rendermonkey. I think it calls them variables though. Just right click the scenegraph-thinngy on the left and add a variable of the right type. If you are unsure of how, check out some of the other samples that come with RM.

Remember to mark them as artist editable if you want to tweak them while your shaders are running. If it was something more advanced you were after, I'm sorry but it was quite a while since I read the article so I dont remember the specifics.

Share this post


Link to post
Share on other sites
Defining and using the variables isn't the problem.
I just don't know how I would keep track of variables, that are view dependant and change with movement - like v3CameraPos, fCameraHeight, or other values, that are being calculated within the OpenGL source.

[Edited by - Hydrael on September 23, 2005 10:40:10 AM]

Share this post


Link to post
Share on other sites
You can tie common variables to uniforms. I'm not sure its enough for your purposes, but view position, etc can be supplied by RM. I dont have RM around at the moment so I cant give you exact instructions on how to do it, play around a bit and you'll find it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hydrael
Defining and using the variables isn't the problem.
I just don't know how I would keep track of variables, that are view dependant and change with movement - like v3CameraPos, fCameraHeight, or other values, that are being calculated within the OpenGL source.


In RM you need to add a variable to your render pass and make it a float,predefined,vViewDirection,vViewPosition,ect... Have a look around these will give you gluLookAt() does...

Share this post


Link to post
Share on other sites
Ah, allright - thanks guys. That works now.
But what about values like those?

pSkyShader->SetUniformParameter1f("fCameraHeight", vCamera.Magnitude());
pSkyShader->SetUniformParameter1f("fKrESun", m_Kr*m_ESun);
[/quote]

That's what I meant by "precalculate". Is there any way to deal with this in RM without calculating those values within the shader itself?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!