<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3AProcedural_animated_texture_generation%2FClocks</id>
	<title>Minecraft:Procedural animated texture generation/Clocks - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3AProcedural_animated_texture_generation%2FClocks"/>
	<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Procedural_animated_texture_generation/Clocks&amp;action=history"/>
	<updated>2026-10-20T02:52:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.sasgaming.net/index.php?title=Minecraft:Procedural_animated_texture_generation/Clocks&amp;diff=198806&amp;oldid=prev</id>
		<title>SyncBot: Sync: new page from Minecraft</title>
		<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Procedural_animated_texture_generation/Clocks&amp;diff=198806&amp;oldid=prev"/>
		<updated>2026-09-15T11:16:22Z</updated>

		<summary type="html">&lt;p&gt;Sync: new page from Minecraft&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;{{exclusive|java|console|section=1}}&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{outdated|Procedurally generated textures such as this one were removed and replaced by pre-rendered animations in [[Minecraft:Java Edition 1.5]] and [[Minecraft:Xbox 360 Edition TU12]].}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To generate its appearances, the clock combined 2 textures, one being the actual clock, and the other being the dial. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
Clock (texture) JE1 BE1.png|Clock texture file&lt;br /&gt;
Dial.png|{{code|dial.png}}&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The logic solely for mixing the two (as there is additional logic for moving the dial in a wobbly fashion that isn&amp;#039;t pertinent here) is as follows:&lt;br /&gt;
[[File:Proctex Clocks Comparisons.gif|300px|thumb|The procedural and pre-rendered clocks compared. The difference in precision is far more obvious in-game.&lt;br /&gt;
If the modern clock sprite were to be procedurally generated it would have only 218 unique frames, as the window to the dial is slightly different.]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python3&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
# Assume RGBA values are handled as 0.0 to 1.0 float values&lt;br /&gt;
def setup_clock_sprite (item: Image, dial: Image, dial_angle: float, output: Image):&lt;br /&gt;
	rx = sin(-dial_angle)&lt;br /&gt;
	ry = cos(-dial_angle)&lt;br /&gt;
	for y in range(item.height):&lt;br /&gt;
		for x in range(item.width):&lt;br /&gt;
			pix = item.get_pixel(x, y)&lt;br /&gt;
			if pix.r == pix.b and pix.g == 0 and pix.b &amp;gt; 0:&lt;br /&gt;
				u: float = -(x / (item.width  - 1) - 0.5)&lt;br /&gt;
				v: float =   y / (item.height - 1) - 0.5&lt;br /&gt;
				dial_pix = dial.get_pixel(&lt;br /&gt;
					int(((u * ry + v * rx + 0.5) * dial.width)) % dial.width,&lt;br /&gt;
					int(((v * ry - u * rx + 0.5) * dial.height)) % dial.height&lt;br /&gt;
				)&lt;br /&gt;
				dial_pix.rgb *= pix.r&lt;br /&gt;
				pix = dial_pix&lt;br /&gt;
			output.set_pixel(x, y, pix)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This results in the item and dial sprites being mixed by fuchsia areas of the clock sprite, as well as being shaded by them (contrary to the popular belief that they were mixed solely on the two shades found on the vanilla sprite).&lt;br /&gt;
This allowed for the clock to be animated precisely, having 230 visually distinct frames, in an era where block and item sprites couldn&amp;#039;t be animated individually without mods. The pre-rendered animated approach, used in 1.5 onward, is far less precise, with only 64 different frames.&lt;br /&gt;
&lt;br /&gt;
[[File:Weirdo_Clock_Example_.gif|320px|thumb|A valid albeit silly clock sprite, showing how the fuchsia areas are used to mix the sprite and dial; Note how the dial gets flipped horizontally.]]&lt;br /&gt;
Due to an oversight with how assets were loaded however, the item sprite for clocks couldn&amp;#039;t be overridden by texture packs (as they are set to always load from the vanilla {{code|gui/items.png}} atlas, stored in {{code|minecraft.jar}}, rather than the one of the currently active texture pack.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category: Textures]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SyncBot</name></author>
	</entry>
</feed>