C# 클래스 Nez.Textures.TextureUtils

various utilties for creating textures on the fly. These can be pretty heavy on the CPU so it's best to not try to use them every frame.
파일 보기 프로젝트 열기: prime31/Nez

공개 메소드들

메소드 설명
createBlurredGrayscaleTexture ( Microsoft.Xna.Framework.Color srcData, int width, int height, double deviation = 1 ) : Microsoft.Xna.Framework.Color[]
createBlurredGrayscaleTexture ( Microsoft.Xna.Framework.Graphics.Texture2D image, double deviation = 1 ) : Microsoft.Xna.Framework.Graphics.Texture2D

creates a new texture that is a gaussian blurred version of the original in grayscale

createBlurredTexture ( Microsoft.Xna.Framework.Color srcData, int width, int height, double deviation = 1 ) : Microsoft.Xna.Framework.Color[]
createBlurredTexture ( Microsoft.Xna.Framework.Graphics.Texture2D image, double deviation = 1 ) : Microsoft.Xna.Framework.Graphics.Texture2D

creates a new texture that is a gaussian blurred version of the original

createFlatHeightmap ( Microsoft.Xna.Framework.Color srcData, Microsoft.Xna.Framework.Color opaqueColor, Microsoft.Xna.Framework.Color transparentColor ) : Microsoft.Xna.Framework.Color[]
createFlatHeightmap ( Microsoft.Xna.Framework.Graphics.Texture2D image, Microsoft.Xna.Framework.Color opaqueColor, Microsoft.Xna.Framework.Color transparentColor ) : Microsoft.Xna.Framework.Graphics.Texture2D

processes each pixel of the passed in Texture and in the output texture transparent pixels will be transparentColor and opaque pixels will be opaqueColor. This is useful for creating normal maps for rim lighting by applying a grayscale blur then using createNormalMap* by doing something like the following. The first step is used only for making rim lighting normal maps: - var maskTex = createFlatHeightmap( tex, Color.White, Color.Black ) - var blurredTex = createBlurredGrayscaleTexture( maskTex, 1 ) - createNormalMap( blurredTex, 50f )

createNormalMap ( Microsoft.Xna.Framework.Color srcData, EdgeDetectionFilter filter, int width, int height, float normalStrength = 1f, bool invertX = false, bool invertY = false ) : Microsoft.Xna.Framework.Color[]
createNormalMap ( Microsoft.Xna.Framework.Graphics.Texture2D image, EdgeDetectionFilter filter, float normalStrength = 1f, bool invertX = false, bool invertY = false ) : Microsoft.Xna.Framework.Graphics.Texture2D

generates a normal map from a height map calculating it with a sobel filter

메소드 상세

createBlurredGrayscaleTexture() 공개 정적인 메소드

public static createBlurredGrayscaleTexture ( Microsoft.Xna.Framework.Color srcData, int width, int height, double deviation = 1 ) : Microsoft.Xna.Framework.Color[]
srcData Microsoft.Xna.Framework.Color
width int
height int
deviation double
리턴 Microsoft.Xna.Framework.Color[]

createBlurredGrayscaleTexture() 공개 정적인 메소드

creates a new texture that is a gaussian blurred version of the original in grayscale
public static createBlurredGrayscaleTexture ( Microsoft.Xna.Framework.Graphics.Texture2D image, double deviation = 1 ) : Microsoft.Xna.Framework.Graphics.Texture2D
image Microsoft.Xna.Framework.Graphics.Texture2D Image.
deviation double Deviation.
리턴 Microsoft.Xna.Framework.Graphics.Texture2D

createBlurredTexture() 공개 정적인 메소드

public static createBlurredTexture ( Microsoft.Xna.Framework.Color srcData, int width, int height, double deviation = 1 ) : Microsoft.Xna.Framework.Color[]
srcData Microsoft.Xna.Framework.Color
width int
height int
deviation double
리턴 Microsoft.Xna.Framework.Color[]

createBlurredTexture() 공개 정적인 메소드

creates a new texture that is a gaussian blurred version of the original
public static createBlurredTexture ( Microsoft.Xna.Framework.Graphics.Texture2D image, double deviation = 1 ) : Microsoft.Xna.Framework.Graphics.Texture2D
image Microsoft.Xna.Framework.Graphics.Texture2D Image.
deviation double Deviation.
리턴 Microsoft.Xna.Framework.Graphics.Texture2D

createFlatHeightmap() 공개 정적인 메소드

public static createFlatHeightmap ( Microsoft.Xna.Framework.Color srcData, Microsoft.Xna.Framework.Color opaqueColor, Microsoft.Xna.Framework.Color transparentColor ) : Microsoft.Xna.Framework.Color[]
srcData Microsoft.Xna.Framework.Color
opaqueColor Microsoft.Xna.Framework.Color
transparentColor Microsoft.Xna.Framework.Color
리턴 Microsoft.Xna.Framework.Color[]

createFlatHeightmap() 공개 정적인 메소드

processes each pixel of the passed in Texture and in the output texture transparent pixels will be transparentColor and opaque pixels will be opaqueColor. This is useful for creating normal maps for rim lighting by applying a grayscale blur then using createNormalMap* by doing something like the following. The first step is used only for making rim lighting normal maps: - var maskTex = createFlatHeightmap( tex, Color.White, Color.Black ) - var blurredTex = createBlurredGrayscaleTexture( maskTex, 1 ) - createNormalMap( blurredTex, 50f )
public static createFlatHeightmap ( Microsoft.Xna.Framework.Graphics.Texture2D image, Microsoft.Xna.Framework.Color opaqueColor, Microsoft.Xna.Framework.Color transparentColor ) : Microsoft.Xna.Framework.Graphics.Texture2D
image Microsoft.Xna.Framework.Graphics.Texture2D Image.
opaqueColor Microsoft.Xna.Framework.Color Opaque color.
transparentColor Microsoft.Xna.Framework.Color Transparent color.
리턴 Microsoft.Xna.Framework.Graphics.Texture2D

createNormalMap() 공개 정적인 메소드

public static createNormalMap ( Microsoft.Xna.Framework.Color srcData, EdgeDetectionFilter filter, int width, int height, float normalStrength = 1f, bool invertX = false, bool invertY = false ) : Microsoft.Xna.Framework.Color[]
srcData Microsoft.Xna.Framework.Color
filter EdgeDetectionFilter
width int
height int
normalStrength float
invertX bool
invertY bool
리턴 Microsoft.Xna.Framework.Color[]

createNormalMap() 공개 정적인 메소드

generates a normal map from a height map calculating it with a sobel filter
public static createNormalMap ( Microsoft.Xna.Framework.Graphics.Texture2D image, EdgeDetectionFilter filter, float normalStrength = 1f, bool invertX = false, bool invertY = false ) : Microsoft.Xna.Framework.Graphics.Texture2D
image Microsoft.Xna.Framework.Graphics.Texture2D Image.
filter EdgeDetectionFilter
normalStrength float Normal strength.
invertX bool
invertY bool
리턴 Microsoft.Xna.Framework.Graphics.Texture2D