Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › ShaderEffects vs Scene scaling

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

    Paweł

    Hi,

    I am using the scene scaling strategy (scene size: 320×480, multi resolution images, etc.). It works fine until I use some ShaderEffects like: DropShadow or ColorOverlay. Such items look blurred on hd/hd2 devices. I use the following workarounds:

    -for images:

    MultiResolutionImage {
    	id: image
    
    	source: "../assets/img/gear.png"
    
    	visible: false
    
    	Component.onCompleted: {
    		width *= 4;
    		height *= 4;
    	}
    }
    
    ColorOverlay {
    	width: 0.25*image.width
    	height: 0.25*image.height
    
    	source: image
    	color: "red"
    
    	anchors.bottom: parent.bottom
    	anchors.right: parent.right
    }

    – for texts:

    Text {
    	id: text
    	text: qsTr("text")
    
    	font.pixelSize: 28
    
    	visible: false
    
    	Component.onCompleted: {
    		width *= 4;
    		height *= 4;
    
    		font.pixelSize *= 4;
    	}
    }
    
    DropShadow {
    	anchors.left: parent.left
    
    	width: text.width
    	height: text.height
    
    	scale: 0.25
    
    	transformOrigin: Item.TopLeft
    
    	horizontalOffset: 0
    	verticalOffset: 8
    	radius: 8
    	samples: 20
    	color: "#80000000"
    	source: text
    }

    However I don’t like their complexity. Is there any better way of using ShaderEffects?

    #13783

    spike

    Hi,

     

    I’ve no clue why MultiResolutionImage does not support it, it definitely should… because the “workaround” is really ugly imo.

    #13785

    Paweł

    Well, I think it’s not the MultiResolutionImage’s fault as it’s only the source of ShaderEffect components which are not the part of the Felgo library. Moreover you can use any item as a source, so it’s understandable it cannot use any Felgo specific component logic. Unfortunately 🙁

    #13788

    Günther
    Felgo Team
    #13858

    Paweł

    Hi Günther,
    the internalContentScaleFactorForImages should be enough in my case.

    Thanks 🙂

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

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded