{"action":"created","issue":{"url":"https://api.github.com/repos/jMonkeyEngine/jmonkeyengine/issues/161","labels_url":"https://api.github.com/repos/jMonkeyEngine/jmonkeyengine/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/jMonkeyEngine/jmonkeyengine/issues/161/comments","events_url":"https://api.github.com/repos/jMonkeyEngine/jmonkeyengine/issues/161/events","html_url":"https://github.com/jMonkeyEngine/jmonkeyengine/pull/161","id":39270466,"number":161,"title":"Extended dds support in the JME-SDK","user":{"login":"shamanDevel","id":1770337,"avatar_url":"https://avatars.githubusercontent.com/u/1770337?v=3","gravatar_id":"","url":"https://api.github.com/users/shamanDevel","html_url":"https://github.com/shamanDevel","followers_url":"https://api.github.com/users/shamanDevel/followers","following_url":"https://api.github.com/users/shamanDevel/following{/other_user}","gists_url":"https://api.github.com/users/shamanDevel/gists{/gist_id}","starred_url":"https://api.github.com/users/shamanDevel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shamanDevel/subscriptions","organizations_url":"https://api.github.com/users/shamanDevel/orgs","repos_url":"https://api.github.com/users/shamanDevel/repos","events_url":"https://api.github.com/users/shamanDevel/events{/privacy}","received_events_url":"https://api.github.com/users/shamanDevel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":28,"created_at":"2014-08-01T08:25:40Z","updated_at":"2015-03-01T20:31:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jMonkeyEngine/jmonkeyengine/pulls/161","html_url":"https://github.com/jMonkeyEngine/jmonkeyengine/pull/161","diff_url":"https://github.com/jMonkeyEngine/jmonkeyengine/pull/161.diff","patch_url":"https://github.com/jMonkeyEngine/jmonkeyengine/pull/161.patch"},"body":"The engine can load dds textures, but the SDK cannot display, open and edit them.\r\nHowever, I think that the dds texture format is one of the most important formats for textures, because it can be directly loaded into the GPU memory.\r\nTherefore, I've added support for these textures in the sdk.\r\n\r\nThese code changes come in four steps:\r\n1. Relax restrictions in the dds loader in the core engine\r\n2. Add libraries to load and store dds textures for the SDK\r\n3. Extend the module Texture-Editor\r\n4. Add a dialog that can convert textures\r\n\r\n<strong>1. Relax restrictions in the dds loader </strong>\r\nThe dds loader tests if the flag \"DDSCAPS_TEXTURE\" is set. However, there exists many vaild textures without these flags (valid because they can be loaded by the official dds loader). Especially the libraries in the next step create textures without that flag.\r\n\r\n<code>\r\ndiff --git a/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java b/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java\r\nindex 8ea46a7..8aa6749 100644\r\n--- a/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java\r\n+++ b/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java\r\n@@ -203,9 +203,10 @@ public class DDSLoader implements AssetLoader {\r\n         texture3D = false;\r\n \r\n         if (!directx10) {\r\n-            if (!is(caps1, DDSCAPS_TEXTURE)) {\r\n-                throw new IOException(\"File is not a texture\");\r\n-            }\r\n+\t\t\t//ignore it, there exists many valid textures that have not this flag set\r\n+//            if (!is(caps1, DDSCAPS_TEXTURE)) {\r\n+//                throw new IOException(\"File is not a texture\");\r\n+//            }\r\n \r\n             if (depth <= 0) {\r\n                 depth = 1;\r\n</code>\r\n\r\n<strong>2. Add libraries to load and store dds textures for the SDK</strong>\r\nI use the library https://code.google.com/p/java-dds/ for reading \r\nand https://github.com/Dahie/DDS-Utils for writing.\r\nThese libraries are a bit old and buggy, but the best I could find.\r\n\r\n<strong>3. Extend the module Texture-Editor</strong>\r\nIn this main step, the texture editor is extended, so that dds textures are recognized as textures and can be read and written.\r\n\r\n<strong>4. Add a dialog that can convert textures</strong>\r\nThe last step is an addon that allows to convert textures to a different format and also allows to compress the dds textures.\r\nThe SDK already support the texture compression tool, but it requires the tool from NVIDIA to be installed. This dialog has limited functionallity,\r\nbut it does not need additional executables. It is also directly integrated into the node structure.\r\n\r\nThis dialog looks like:\r\n![dds-converter](https://cloud.githubusercontent.com/assets/1770337/3776475/0f371334-1955-11e4-9d29-dc38ff393289.jpg)\r\n"},"comment":{"url":"https://api.github.com/repos/jMonkeyEngine/jmonkeyengine/issues/comments/76628841","html_url":"https://github.com/jMonkeyEngine/jmonkeyengine/pull/161#issuecomment-76628841","issue_url":"https://api.github.com/repos/jMonkeyEngine/jmonkeyengine/issues/161","id":76628841,"user":{"login":"normen","id":3270528,"avatar_url":"https://avatars.githubusercontent.com/u/3270528?v=3","gravatar_id":"","url":"https://api.github.com/users/normen","html_url":"https://github.com/normen","followers_url":"https://api.github.com/users/normen/followers","following_url":"https://api.github.com/users/normen/following{/other_user}","gists_url":"https://api.github.com/users/normen/gists{/gist_id}","starred_url":"https://api.github.com/users/normen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normen/subscriptions","organizations_url":"https://api.github.com/users/normen/orgs","repos_url":"https://api.github.com/users/normen/repos","events_url":"https://api.github.com/users/normen/events{/privacy}","received_events_url":"https://api.github.com/users/normen/received_events","type":"User","site_admin":false},"created_at":"2015-03-01T20:31:48Z","updated_at":"2015-03-01T20:31:48Z","body":"Well this whole PR is about the SDK if I'm not mistaken? :) The texture editor has a \"plugin system\" for file formats and the conversion dialog is independent anyway so I think it shouldn't be too hard to make it a separate plugin."}}