We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Change Depth Test / Rendering order on hover?

Home Forums Programming Change Depth Test / Rendering order on hover?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #34585
    web
    Customer

    Is it possible to change the Depth Test / Rendering Order on hover?

    I would need to make a semi transparent object render above all other geometry when Its hovered.

    Also a litte hint regarding the documentation. In the 3dsMax documentation its written that you need to disable the Depth Write option in order to render an object above all, but it needs to be the Depth Test option. Maybe the verge Team could fix this.

    #34587
    web
    Customer

    Just did some testing. You can easily the depthTest attribute for a material via javascript.

    I was just wondering if you could alter material settings on runtime instead of “recreating” a material, which I’m doing at the moment.

    At the moment I running a function on hover for specified objects at creating a material like this:

    function initial(objectname, depth){
        
        var object = getObjectByName(objectname);
        var colorHighlight = new v3d.Color('#004380');
    
        object.material = new v3d.MeshLambertMaterial({
            color: '#000',
            emissive: colorHighlight,
            emissiveIntensity: 1,
            opacity: 0.5,
            transparent: true,
            depthTest: depth 
        });
    }
    #34608

    Yep, you can create the materials at application startup and then switch between materials on hover (or modify its parameters).

    Chief 3D Verger | LinkedIn | Twitter

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.