Real lava surface

Home Forums AR Sandbox Forum Real lava surface

This topic contains 4 replies, has 3 voices, and was last updated by  Candycane 1 week, 5 days ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #117828

    tomchadwin
    Participant

    Hello

    I’ve seen that -rws doesn’t support the alternative shaders (eg lava) – https://arsandbox.ucdavis.edu/forums/topic/ar-vr-dual-monitors/#post-116087. What would be involved to get this working? Even just changing the material colour would be a start. I can see that a vector “color” is declared in the GL shader (WaterRenderingShader), but I’ve not managed to find where the water colour is passed in (can’t find it in WaterRenderer). I also don’t know whether implementing a change will be as simple as it is without -rws, as I don’t know whether the change can be carried out entirely in the shader (and hence immediately take effect when the shader code is changed). Can anyone give me some help? I have no GL or C++ experience, but I’m happy to try.

    Thanks

    Tom

    #117832

    tomchadwin
    Participant

    I’ve found where the real water surface (-rws) colour is set:

    if(rs.waterRenderer!=0)
    	{
    	/* Draw the water surface: */
    	glMaterialAmbientAndDiffuse(GLMaterialEnums::FRONT,GLColor<GLfloat,4>(0.0f,0.5f,0.8f));

    However, this is in the source, and requires recompilation to change. We need to change it during runtime. I don’t yet know how to do that – can anyone help?

    Thanks

    Tom

    • This reply was modified 3 weeks, 4 days ago by  tomchadwin. Reason: Format code
    #117900

    Oliver Kreylos
    Keymaster

    The “real water surface” renderer doesn’t use explicit shaders, and the material properties for the surface are hardcoded right now, in the place where you found them. It would be a medium-scale change to move from fixed functionality to a shader, and ideally use the same shader source as the texture-based water renderer.

    #117973

    tomchadwin
    Participant

    Thanks – understood. Would there be an easier change to expose some kind of extremely primitive API so that a shell script, rather than overwriting the shader file, could change the -rws colour at a C++ level at runtime, rather than via WebGL?

    Thanks again

    Tom

    #117984

    Candycane
    Participant

    nice

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Comments are closed.