Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Commit

Permalink
Import all sources from perforce.
Browse files Browse the repository at this point in the history
  • Loading branch information
castano committed Apr 17, 2007
0 parents commit 7543dd1
Show file tree
Hide file tree
Showing 197 changed files with 49,819 additions and 0 deletions.
45 changes: 45 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0)
PROJECT(NV)
ENABLE_TESTING()

SET(NV_CMAKE_DIR "${NV_SOURCE_DIR}/cmake")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}")

IF(WIN32)
SET(GNUWIN32 "${NV_SOURCE_DIR}/gnuwin32")
SET(CMAKE_INCLUDE_PATH "${GNUWIN32}/include")
SET(CMAKE_LIBRARY_PATH "${GNUWIN32}/lib")
ENDIF(WIN32)

# In single config builds:
#IF(NOT CMAKE_CONFIGURATION_TYPES)
# IF (CMAKE_BUILD_TYPE MATCHES Debug)
# ADD_DEFINITIONS(-D_DEBUG)
# # ADD_DEFINITIONS(-DDEBUG)
# ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
#ELSE(NOT CMAKE_CONFIGURATION_TYPES)
# SET(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} "-D_DEBUG")
# SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} "-DNDEBUG")
#ENDIF(NOT CMAKE_CONFIGURATION_TYPES)

IF(MSVC)
# @@ Some of these might only be available in VC8.
# Code generation flags.
# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:SSE2 /fp:fast")
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2 /fp:fast")

# Optimization flags.
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} /O2 /Ob2 /Oi /Ot /Oy /GL")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /O2 /Ob2 /Oi /Ot /Oy /GL")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG")

# Definitions.
ADD_DEFINITIONS(-D__SSE2__ -D__SSE__ -D__MMX__)
ENDIF(MSVC)

#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=pentium4")

ADD_SUBDIRECTORY(src)

15 changes: 15 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
NVIDIA Texture Tools version 0.9.0
* Private beta prerelease.

NVIDIA Texture Tools version 0.9.1
* Bug fix release.

NVIDIA Texture Tools version 0.9.2
* Improved alpha compression.
* Improved fast DXT1 compression.
* Documentation and release notes.

NVIDIA Texture Tools version 0.9.3
* Fix non power of two textures.
* Fix estimateSize with rgb format.
* Fix error in cuda compressor block limit.
24 changes: 24 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
The NVIDIA Texture Tools are licensed under the MIT license.

Copyright (c) 2007 NVIDIA Corporation

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
24 changes: 24 additions & 0 deletions NVIDIA_Texture_Tools_LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
The NVIDIA Texture Tools are licensed under the MIT license.

Copyright (c) 2007 NVIDIA Corporation

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
161 changes: 161 additions & 0 deletions NVIDIA_Texture_Tools_README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
NVIDIA Texture Tools
README.txt
Version 0.9.2
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
TABLE OF CONTENTS
--------------------------------------------------------------------------------
I. Instructions
II. Contents
III. Compilation Instructions
IV. Using NVIDIA Texture Tools in your own applications
V. Known Issues
VI. Frequently Asked Questions
--------------------------------------------------------------------------------

I. Introduction
--------------------------------------------------------------------------------

This is our first alpha release of our new Texture Tools. The main highlights of
this release are support for all DX10 texture formats, higher speed and improved
compression quality.

In addition to that it also comes with a hardware accelerated compressor that
uses CUDA to compress blocks in parallel on the GPU and runs around 10 times
faster than the CPU counterpart.

You can obtain CUDA from our developer site at:

http://developer.nvidia.com/object/cuda.html

The source code of the Texture Tools is being released under the terms of
the MIT license.


II. Contents
--------------------------------------------------------------------------------

This release contains only the source code of the texture compression library
and an example commandline application that shows its use.


III. Compilation Instructions
--------------------------------------------------------------------------------

The compression library and the example can be compiled with Visual Studio 8 on
Windows using the following solution file:

project\vc8\nvtt.sln

On most other platforms you can also use cmake. For more information about
cmake, visit:

http://www.cmake.org/

On unix systems you can use the standard build procedure (assuming cmake is
installed on your system):

$ ./configure
$ make
$ sudo make install


IV. Using NVIDIA Texture Tools
--------------------------------------------------------------------------------

To use the NVIDIA Texture Tools in your own applications you just have to
include the following header file:

src/nvimage/nvtt/nvtt.h

And include the nvtt library in your projects.

The following file contains a simple example that shows how to use the library:

src/nvimage/nvtt/compress.cpp

The usage of the commandline tool is the following:

$ nvcompress [options] infile [outfile]

where 'infile' is and TGA, PNG or JPG file, 'outfile' is a DDS file and
'options' is one or more of the following:

Input options:
-color The input image is a color map (default).
-normal The input image is a normal map.
-tonormal Convert input to normal map.
-clamp Clamp wrapping mode (default).
-repeat Repeat wrapping mode.
-nomips Disable mipmap generation.

Compression options:
-fast Fast compression.
-nocuda Do not use cuda compressor.
-rgb RGBA format
-bc1 BC1 format (DXT1)
-bc2 BC2 format (DXT3)
-bc3 BC3 format (DXT5)
-bc3n BC3 normal map format (DXT5n/RXGB)
-bc4 BC4 format (ATI1)
-bc5 BC5 format (3Dc/ATI2)

In order to run the compiled example on a PC that doesn't have Microsoft Visual
Studio 2003 installed, you will have to install the Microsoft Visual Studio 2003
redistributable package that you can download at:

http://go.microsoft.com/fwlink/?linkid=65127&clcid=0x409


V. Known Issues
--------------------------------------------------------------------------------

None so far. Please send suggestions and bug reports to: [email protected].


VI. Frequently Asked Questions
--------------------------------------------------------------------------------

- Do the NVIDIA Texture Tools work on OSX?
It currently compiles and runs properly, but it has not been tested extensively.
In particular there may be endiannes errors in the code.


- Do the NVIDIA Texture Tools work on Linux?
Yes.


- Do the NVIDIA Texture Tools work on Vista?
Yes, but note that CUDA is not supported on Vista yet, so the tool is not hardware
accellerated.


- Is CUDA required?
No. The Visual Studio solution file contains a configuration that allows you
to compile the texture tools without CUDA support. The cmake scripts automatically
detect the CUDA installation and use it only when available.


- Where can I get CUDA?
http://developer.nvidia.com/object/cuda.html


- Why is feature XYZ not supported?
In order to keep the code small and reduce maintenance costs we have limited the
features available in our new texture tools. We also have open sourced the code, so
that people can modify it and add their own favourite features.


- Can I use the NVIDIA Texture Tools in my commercial application?
Yes, the NVIDIA Texture Tools are licensed under the MIT license.


- Can I use the NVIDIA Texture Tools in my GPL application?
Yes, the MIT license is compatible with the GPL and LGPL licenses.



21 changes: 21 additions & 0 deletions NVIDIA_Texture_Tools_TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

Short term:
- Improve quality of fast compressors.
- More accellerated compressors.
- Accellerate mipmap generation.
- Generic RGB pixel format conversion.
- Do not assume that alpha is used for transparency.

Longer term:
- support non power of two textures.
- support for DXT1a format.
- support for correct cubemap filtering.
- support for correct cubemap borders and atlas borders. (Crytek request)
- support for 3d textures & 3d compression.
- Add support for occlusion map, horizon map & bent normal map generation.
- Add support for accurate normal map mipmap computation. Using lighting integrals.
- Add support for YCoCg and JPEG-LS color transforms. Add high quality DXT5-RGB compression.
- Add full support for mirror wrap mode.
- Generation of cone maps for relief mapping.
- Add min/max box mipmap filters.

1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.9.3
Loading

0 comments on commit 7543dd1

Please sign in to comment.