Displacement Mapping
Reported by lindsay.kay (at xeolabs) | April 29th, 2010 @ 01:15 AM
Add support for displacement mapping to the SceneJS.Texture node.
This would involve extending the texture layer "applyTo" mode to target texturing output at vertices within GLSL, along with extensions to the GLSL program generator.
Notes
- Internal pixel format of GL_RGBA_FLOAT32_ATI
- Map must not be filtered - must be nearest mode
Bilear filtering can be done in GLSL like this though:
#define textureSize 256.0
#define texelSize 1.0 / 256.0
vec4 texture2D_bilinear( uniform sampler2D tex, vec2 uv )
{
vec2 f = fract( uv.xy * textureSize );
vec4 t00 = texture2D( tex, uv );
vec4 t10 = texture2D( tex, uv + vec2( texelSize, 0.0 ));
vec4 tA = mix( t00, t10, f.x );
vec4 t01 = texture2D( tex, uv + vec2( 0.0, texelSize ) );
vec4 t11 = texture2D( tex, uv + vec2( texelSize, texelSize ) );
vec4 tB = mix( t01, t11, f.x );
return mix( tA, tB, f.y );
}
Links
Comments and changes to this ticket
-
lindsay.kay (at xeolabs) May 2nd, 2010 @ 08:31 AM
- Milestone set to V0.7.4
-
lindsay.kay (at xeolabs) May 5th, 2010 @ 04:06 AM
- Milestone changed from V0.7.4 to V0.7.5
-
lindsay.kay (at xeolabs) May 11th, 2010 @ 07:00 AM
- Milestone cleared.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
SceneJS provides easy access to WebGL through a simple and declarative JavaScript API. The SceneJS API is functional, which enables its scene definitions to be really compact and expressive, while hooking into other JavaScript code just that little bit more smoothly.