Kodi Community Forum
multiimage using a diffuse texture, does not fade nicely - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: multiimage using a diffuse texture, does not fade nicely (/showthread.php?tid=40740)



multiimage using a diffuse texture, does not fade nicely - Nuka1195 - 2008-11-20

PHP Code:
<!-- Fanart multiimage -->
            <
control type="multiimage">
                <
description>fanart multiimage</description>
                <
posx>50</posx>
                <
posy>50</posy>
                <
width>630</width>
                <
height>445</height>
                <
imagepath diffuse="twc-fanart-diffuse.png">$INFO[Skin.String(twc-fanart-path)]/$INFO[Weather.Location]</imagepath>
                <
timeperimage>2000</timeperimage>
                <
pauseatend>0</pauseatend>
                <
fadetime>500</fadetime>
                <
randomize>true</randomize>
                <
loop>yes</loop>
                <
aspectratio>stretch</aspectratio>
            </
control

that is the control i'm using, it all works, but the fade flashes. is this unavoidable with a multiimage or is there something i've messed up.

i can supply a sample script if need be.


- jmarshall - 2008-11-20

If the diffuse image contains transparency, then yes. The problem is that to cross fade between two images you have to actually render the previous image first, then put the next one on top. As it is at the moment, it will cause a flash when the bottom image then disappears (which would normally be completely hidden behind the front one), as the top image is partially transparent due to the diffuse image.

We *may* be able to workaround it by allowing the skinner to specify a base transparency so that we can apply the alternate fade function we use when the images have an alpha fade on them. This then uses a fading technique that takes into account the fact that both images are a bit transparent.

See CGUIMultiImage::Render() for the code - we'd have to specify m_diffuseColor separately (without it actually applying to the image).

Cheers,
Jonathan


- Nuka1195 - 2008-11-20

let me clarify.

jmarshall, you fixed the fading of multiimages when the images were partially transparent. the diffuse texture is a 35% texture, so is there anyway for you to take the diffuse texture into account when transforming?


- Nuka1195 - 2008-11-20

Smile


- Nuka1195 - 2008-11-20

<colordiffuse> fades nicely, but doesn't clip, so i did a full opacity diffuse texture and the <colordiffuse> and it works perfect, so probably no need to change anything.

thanks.


- Nuka1195 - 2008-11-20

Smile i was going to request <colordiffuse> accept an infolabel, so users could set the fade, but it already works.


- Nuka1195 - 2008-11-20

yes, you guessed it. feature request. all control settings run thru $INFO[] so i could have fadetime and timesperimage user selectable. Smile


- jmarshall - 2008-11-20

Not without knowing the number in advance. If you know it's 35% or whatever, then yes it's possible, but we'd have to add an additional tag to the multiimage control first.

EDIT: Ignore this Smile