• 13
• 15
• 27
• 9
• 9

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

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

## 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 on other sites
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 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 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 on other sites
Quote:
 Original post by HydraelDefining 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...

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?