Generate Texture in Silverlight imitate leather - silverlight

I would like to display textures in different colors pretty much having this texture.
How do I do this in Silverlight?
Thanks!
alt text http://a.imageshack.us/img535/5255/leathertexture.png

Turn your texture into alpha textue. Exact steps will depend on your image manipulation software. After that simply place your texture on top of colored rectangle.
You could make pixel shader for even better result, but that would be an overkill in your case.

Related

Applying a pixel shader to a ViewPort3D

I'm new to pixel shaders, and I'm trying to apply an underwater-effect to my 3d scene. I can apply it to an image and animate it easily enough, but not to my ViewPort3D. The computer just hangs when calling BeginAnimation on the effect being applied to the Viewport3D. Is this something that cannot be done in WPF?
After a little digging I learned that pixel shaders are only applied to 2 dimensional types, like images. So what I would need is called a vertex shader, which for WPF, there are none.

OpenGL texture transformations

I'm a beginner to OpenGL and I'd like a simple introduction to using textures. For my application, I have no need of geometry, just some texture manipulation. I want to be able to scale, rotate, and translate textures, blend textures together (mixing R,G,B components), and display textures on the screen. If you could also tell me how to draw a solid filled rectangle, that would be good.
I'm also fuzzy on shaders. Could I use GLSL to transform the color at every point on a texture by a formula?
Examples or explanations in C would be preferred.
You have asked a lot of questions...
If you want to play with textures and do some 2d effects here is a little pseudocode that could help:
render() {
glClear(...)
glUseProgram(shader_program);
bind_textures();
setup_shader_params();
draw_fullscreen_quad();
glUseProgram(0);
// rest of opengl...
}
read more on:
http://www.arcsynthesis.org/gltut/Basics/Tut01%20Following%20the%20Data.html
What's the best way to draw a fullscreen quad in OpenGL 3.2?

How to work with pixels in WP7 Silverlight?

I have an image, I want to get a pixel color, replace a pixel color with another, and other operations on pixels.
Is there a way to do that? And what libraries are needed?
Have a look at the WriteableBitmapEx library. This will allow you to manipulate pixels directly.

Light Map projection

What i'm trying to do is making a "light projector" with visible ray(like with fog) also called volumetric light;
and which project a image (bitmap) ;
Because i would like to keep this project connected with a wpf application ( to get brush, position, rotation from data), i've choose to use WPF 3D
But it seem that WPF can't handle light projection or render ray.
So to do that, i have extruded each pixel of my source bitmap into a polygon colored by a solidColorBrush of the pixel color.
and keep the pixel order with (x,y) position.
For performance issue, i've set all the bitmaps to 32x32 px ( 1024 polygon for only one light !!)
But the result is too pixelated as you can see on the picture.
Moreover, it probably take much memory for nothing ...
my question is, how can i make it smooth or even rethink the extrusion system to optimize performance ...
Is any other tehnology that can be integrated into a wpf application and do that better or easier ?
Thanks, and sorry my English is pretty bad ...
alt text http://www.visualdmx.fr/pic_example.png

Can pixel shaders be used when rendering to an offscreen surface?

I'm considering integrating some D3D code I have with WPF via the new D3DImage as described
here:
My question is this: Do pixel shader's work on offscreen surfaces?
Rendering to an offscreen surface is generally less constrained than rendering directly to a back buffer. The only constraints that come with using an offscreen surface with D3DImage is that it must be in a 32-bit RGB/ARGB format (depending on your platform). Other than that, all that the hardware has to offer is at your disposal.
In fact, tons of shader effects take advantage of offscreen surfaces for multipass, or full screen post-processing.
I don't know if there's anything special about it with WPF, but in general yes, pixel shaders work on offscreen surfaces.
For some effects rendering to a different surface is required - glass refraction in front of a shader-rendered scene for example. Pixel shaders cannot access the current screen contents and so the view has to be first rendered to a buffer and then used as a texture in the refraction shader pass so that it can take the background colour from a pixel other than the one being calculated.

Resources