opengl:glsl_hlsl
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン次のリビジョン両方とも次のリビジョン | ||
opengl:glsl_hlsl [2014/07/02 16:39] – [GLSL/HLSL 命令対応表] oga | opengl:glsl_hlsl [2014/09/13 16:03] – [GLSL/HLSL 命令対応表] oga | ||
---|---|---|---|
行 2: | 行 2: | ||
- | ^ GLSL ^ HLSL | + | ^ GLSL ^ HLSL |
| float | float | float | | | | float | float | float | | | ||
- | | | + | | -- |
- | | vec2 | float2 | + | | vec2/ |
- | | vec3 | float3 | + | |
- | | vec4 | float4 | + | |
| mat3 | float3x3 | | mat3 | float3x3 | ||
| mat4 | float4x4 | | mat4 | float4x4 | ||
行 13: | 行 11: | ||
| int | int | int | | | | int | int | int | | | ||
| ivec2/ | | ivec2/ | ||
+ | | uint | uint | uint (unsigned int) | ||
+ | | uvec2/ | ||
| bool | bool | bool | | bool | bool | bool | ||
| bvec2/ | | bvec2/ | ||
- | | lowp float | min10float | + | | lowp float | min10float |
- | | mediump float | half (min16float) | + | | mediump float | half (min16float) |
| highp float | float | float | 32bit fp | | | highp float | float | float | 32bit fp | | ||
- | | double | + | | double |
- | | highp int | + | | highp int / uint |
- | | highp uint | uint | uint | 32bit unsigned | + | | mediump int / uint | min16int / min16uint |
- | | mediump | + | | lowp int / uint |
+ | | -- | -- | char / uchar | 8bit int | | ||
| vec3 x= vec3( a, b, c ); | float3 x= { a, b, c }; | float3 x= { a, b, c }; | | | vec3 x= vec3( a, b, c ); | float3 x= { a, b, c }; | float3 x= { a, b, c }; | | ||
| ::: | float3 x= float3( a, b, c ); | float3 x= float3( a, b, c ); | | | | ::: | float3 x= float3( a, b, c ); | float3 x= float3( a, b, c ); | | | ||
| float x[3]= float[]( a, b, c ); | float x[3]= { a, b, c }; | float x[3]= { a, b, c }; | | float x[3]= float[]( a, b, c ); | float x[3]= { a, b, c }; | float x[3]= { a, b, c }; | ||
- | | type( x ) | (type)x | + | | type( x ) | (type)x |
| matrix * matrix | | matrix * matrix | ||
| vector * matrix | | vector * matrix | ||
- | | uniform | + | | uniform |
- | | in/out , varying/ | + | | in/out , varying/ |
- | | builtin gl_* variables | + | | builtin gl_* variables |
行 39: | 行 40: | ||
- | ^ GLSL ^ HLSL | + | |
+ | |||
+ | ^ GLSL ^ HLSL | ||
| inversesqrt( x ) | rsqrt( x ) | rsqrt( x ) | 1/sqrt( x ) | | | inversesqrt( x ) | rsqrt( x ) | rsqrt( x ) | 1/sqrt( x ) | | ||
| mix( x, y, s ) | lerp( x, y, s ) | mix( x, y, s ) | | mix( x, y, s ) | lerp( x, y, s ) | mix( x, y, s ) | ||
行 49: | 行 52: | ||
+ | ^ GLSL ^ HLSL ^ Metal ^ ^ | ||
+ | | sampler2D samplerobj | ||
+ | | sampler2DShadow depthobj | ||
+ | | v= texture( samplerobj, texcoord.. ); | v= texobj.Sample( texcoord.. ); | v= texobj.sample( sampler, texcoord .. ) | sampling | ||
+ | | v= texture2D( sampleobj, texcoord.. ); | v= tex2D( sampler, texcoord.. ); | -- | legacy syntax | ||
+ | | v= textureGather( depthobj, texcoord.. ); | v= depthobj.SampleCmp( texcoord.. ); | v= depthobj.sample_compare( ... ) | pcf shadow map | | ||
- | ^ GLSL ^ HLSL ^ ^ | ||
- | | sampler2D samplerobj | ||
- | | sampler2DShadow shadowobj | ||
- | | v= texture( samplerobj, texcoord.. ); | v= textureobj.Sample( texcoord.. ); | sampling | ||
- | | v= texture2D( sampleobj, texcoord.. ); | v= tex2D( sampler, texcoord.. ); | legacy syntax | ||
- | | v= textureGather( sadowobj, texcoord.. ); | v= shadowobj.SampleCmp( texcoord.. ); | pcf shadow map | | ||
- | ^ shader | ||
- | | vsh | in int gl_VertexID; | ||
- | | ::: | in int gl_InstanceID; | ||
- | | fsh/psh | out vec4 color; (GL2: gl_FragColor) | ||
- | | ::: | out float gl_FragDepth; | ||
+ | ^ shader | ||
+ | | vsh | in int gl_VertexID; | ||
+ | | ::: | in int gl_InstanceID; | ||
+ | | ::: | out vec4 gl_Position; | ||
+ | | fsh/psh | out vec4 color; (GL2: gl_FragColor) | ||
+ | | ::: | out float gl_FragDepth; | ||
opengl/glsl_hlsl.txt · 最終更新: 2016/09/12 14:53 by oga