{"id":16728754,"url":"https://github.com/enoughtea/dades","last_synced_at":"2025-04-10T11:07:30.370Z","repository":{"id":74505412,"uuid":"59026617","full_name":"EnoughTea/dades","owner":"EnoughTea","description":"Simple managed reader for a DDS format, created with both DirectX and OpenGL in mind.","archived":false,"fork":false,"pushed_at":"2017-06-15T22:20:07.000Z","size":3746,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T09:52:51.344Z","etag":null,"topics":["c-sharp","cubemap","dds","dds-files","dds-format","dds-loader","dds-reading","opengl","texture"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EnoughTea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-17T13:49:36.000Z","updated_at":"2024-05-30T17:56:32.000Z","dependencies_parsed_at":"2023-03-15T18:16:06.819Z","dependency_job_id":null,"html_url":"https://github.com/EnoughTea/dades","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnoughTea%2Fdades","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnoughTea%2Fdades/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnoughTea%2Fdades/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnoughTea%2Fdades/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EnoughTea","download_url":"https://codeload.github.com/EnoughTea/dades/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208540,"owners_count":21065202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","cubemap","dds","dds-files","dds-format","dds-loader","dds-reading","opengl","texture"],"created_at":"2024-10-12T23:11:35.273Z","updated_at":"2025-04-10T11:07:30.362Z","avatar_url":"https://github.com/EnoughTea.png","language":"C#","readme":"# Dades #\n\nSimple managed reader for a DDS format, created with both DirectX and OpenGL in mind.\n\n![DDS file shown with OpenGL](shot-1.png)\n\n\n## What does it do? ##\n\nIt allows you to read almost any DirectDraw Surface file without XNA and using managed code only.\nIt was designed as a quick and straightforward way to read most of DDS files, except packed formats like Y410 or NV12.\nThere is also an OpenGL example which shows what to do with read pixel data.\n\n\n## Are there any existing solutions for DDS reading? ##\n\n- OpenTK example DDS loader cannot deal with partial cubemaps and formats other than DXT1-5.\n- DevIL .NET Wrapper can only deal with flat textures and doesn't parallelize well.\n- DDSLib supports a fair amount of formats, but requires XNA.\n\nThere could be a better DDS loader in a C++ world, if you are into wrappers and interop.\n\n## Pros: ##\n\n- No need for XNA or unmanaged code.\n- Supports all texture types — regular flat textures, volume textures and cube-maps with 1–6 faces — and their arrays.\n- Supports **a lot** of formats.\n- Deals with DDS reading mostly, so its pretty easy to learn and use, just write 1 line of code to read a DDS file.\n- Can do optional vertical flipping for OpenGL convenience, in case you don't want to flip UVs for some reason.\n- I prepared a short but comprehensive example of loading all texture types to OpenGL via OpenTK.\n\n\n## Cons: ##\n\n- Cannot write DDS files.\n- Cannot load DDS data into a standard GDI+ Bitmap class, but it should be straightforward to implement, at least for most formats. \nCheck *DadesOglExample/PixelFormatInfo.cs* to see how DX formats correspond to usual pixel formats.\n- I was too lazy to do proper TDD; also no guarantees for big-endian systems, needs testing.\n\n\n## Usage ##\n\nSimply create a DdsFileData and pass it a .dds file or a stream:\n\n    // If you intend to pass read data into OpenGL texture, you probably want 'doVerticalFlip' set to 'true'.\n    var dds = new DdsFileData(\"some_texture_filename.dds\", doVerticalFlip=true);\n\nthen look at its properties:\n\n    foreach (var texture in dds.Textures)  // Usually there is just one texture here, though.\n    {\n        foreach (var surface in texture.Surfaces)   // Each texture can be composed of several surfaces, usually mip-maps.\n        {\n            // Do whatever you want with a surface here.\n            // There are surface type, level, width, height and bytes array available to you.\n        }\n    }\n\nFor a more complete example showcasing OpenGL loading take a look at the *DadesOglExample/SimpleTexture.cs*.\n\n\n# Credits #\n\nThanks to [Racer](http://www.racer.nl/tech/dds.htm) (a free car simulator project) for BC1-3 block flipping code idea :)\n\n### Where all of the example textures came from ##\n\n#### Flat textures ###\n\nAll wose_*.dss were generated with **texconv** tool from [DirectXTex project](http://directxtex.codeplex.com/)\nThese images use a sprite of *Wose* from the great game \"[Battle for Wesnoth](http://wesnoth.org/)\". Give it a try sometimes.\n\nNote that some of the generated images are marked as *empty*: they contain a correct header for their format, but no pixel data.\n\n#### Cube-maps ###\n\nCubemaps were generated with [AMD's cubemap generator](http://code.google.com/p/cubemapgen/).\nImage data came as a result of a Google image search without any copyright info, I have no idea if it belongs to anyone or not.\n\n#### Volume textures ###\n\nNoise3D.dds is a standard noise texture from DirectX SDK.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenoughtea%2Fdades","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenoughtea%2Fdades","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenoughtea%2Fdades/lists"}