Tag Info

Hot answers tagged

20

The physical basis of the colors of an oil slick is iridescence, and also related to Newton's rings. Specifically, the thickness of the oil layer is on the order of the wavelength of light. Since light reflects from both the top and bottom surface of the oil, at any given wavelength, at some angles the two reflections will be out of phase and cancel each ...


10

It looks like simple vertex colouring where the colour index is function of the distance to the centre of the ship, plus time. This can be implemented using a texture storing a palette. It could also be done proceduraly if the desired colour gradients are simple enough. If using a palette, the vertex shader would be something like this: uniform float4 ...


8

This all happens on the CPU side, so if caching were a useful feature, then I would speculate that the graphics driver would implement it itself. Adding your own caching layer is unnecessary. My understanding is that whenever you set a parameter, and whenever you call Apply, these calls are passed to DirectX largely as-is, and in turn passed to the ...


6

It's not an effect. The art in Braid is hand created digital art. It is time consuming and requires a great amount of artistic ability. Learn color theory. Learn how to paint. Learn how to use raster art programs. Here is a page that has a lot of braid art explained, it has snapshots over-time to show the evolution. To make the background move like ...


5

Per-pixel image processing on the CPU is something where microƶptimization is worth thinking about from the start. You're doing memory allocation and object initialization on a per-pixel basis; this is probably most of your problem. The first thing you should do is figure out how to use only arrays of primitives (byte[] etc.) to perform your computation. ...


4

The background animation is done through a complicated combination of particle effects (snow, clouds, and so on) and what looks like a layering of many translucent layers that are not only parallaxed; they also slowly scale and rotate to give a feeling of drifting movement. When combined with traditional frame-by-frame animation, this has a very rich effect. ...


4

That is correct: RenderTextures are not necessarily cleared after being released or reacquired. According to the documentation: You can not depend on any particular contents of the RenderTexture you get from GetTemporary function. It might be garbage, or it might be cleared to some color, depending on the platform. If you want the RenderTexture to be ...


4

Kevin gave you a good list of what you really need to do first to improve the performance of the code. However I would just throw out the code and implement the effect on higher level so that Java can utilize native code and GPU. Radial blur Based on the screenshot it looks like the effect you are looking for is radial blur with rotation. These can be ...


3

The problem with naively rendering a small scanline texture onto a large full-screen quad is that the texture will scale up, making what was a set of single-pixel scanlines in the texture much thicker, blurrier (depending on your interpolation method), and generally uglier. You should instead tile the texture across the quad in such a way as to preserve a ...


3

While I don't think they'll give you what you're asking for out of the box, you should definitely check out these two classes because they might be able to get you something very close. CCShaky3D & CCRipple3D Play around with those effects and see if you can get close. If you can't, you can always dive deeper into the engine to see how those effects ...


3

I think Sprite.Begin will set it's own shader for drawing sprites and overwrite yours. So change the order. sprite.Begin(); effect.BeginPass(i); note: This is how it works with Xna, and i don't think your shader is ready for what sprite.Draw will do


3

Store the logical screen position and the actual screen position in separate containers... The logical screen position is the position, where the screen should be, when no shaking happens... When shaking happens apply some offset to the logical screen position to get the actual screen position. I made a little example (not tested and not completly ...


3

One interesting thing I found about this topic. From msdn: You can use the Parameters indexed property on Effect to access any effect parameter, but this is slower than using EffectParameters. For this reason, you should create an EffectParameter for each effect parameter that changes frequently. and Creating and assigning a EffectParameter ...


3

Creating quads: http://msdn.microsoft.com/en-us/library/bb464051(v=xnagamestudio.10).aspx. You need only one quad per segment, as in image 9 "lightning vertices" of the linked article you mentioned. Next, the glow is first created by having a bitmap, a simple circle will do nicely, which blends from hard bright center to soft darker outside, and alpha ...


2

This is not really dynamically coloring but you can alter the lighting effects to achieve the same thing. The AmbientLightColor effect should work. effect.AmbientLightColor = new Color(r, b, g); Also there is an effect.alpha that you use for transparency iirc which takes a float between 0-1.


2

The idea of blending 4 textures together by using a 5th texture to specify how to blend them together can be easily extended to 8, 12, 16, ... textures. As a quick refresher this is how the default approach works: You have 4 textures for detailing, for example: Rocks Grass Water Concrete And one texture which specifies how to blend these together. In ...


2

You have two broad approaches. You can use multiple effects, making multiple draw calls per model and switching effects between each. This is straightforward and would probably handle your simple multi-texturing and ambient shader combinations, and others like it, fairly easily. The trick is that you have to adjust the pipeline's blend mode between each ...


2

The Unity team published a nice slide deck at SIGGRAPH 2011 with a whole palette of special effects that can be achieved with depth. These are low-cost when using deferred rendering, but still available when using forward rendering at the cost of a pass to create the depth texture. Their outline effect is described on slides 46-47, and should be possible to ...


1

This error can mean: You forgot to install the DirectX SDK. You need to try reinstalling the DirectX SDK. Depending on your other code, you need to install the Debug Runtimes (specifically if you're using CreateWithSwapChain from one of the demos). This could also help get you more information. You'll need to debug more. There's a page of Debugging tips ...


1

I just developed a similiar thing for my project and it works, but it's bad for debugging so I skipped it. What I did was implement this: http://blogs.msdn.com/b/shawnhar/archive/2010/05/07/effect-compilation-and-content-pipeline-automation-in-xna-game-studio-4-0.aspx I have an Engine DLL Library and in it I just created a resource file, called ...


1

Your models are being rendered black because of the line return float4(0, 0, 0, 0) in the pixel shader; the return value for this method is the colour (in RBGA) that is being displayed (in your case, black). You are returning the same value irrespective of the model, which is causing your problem. You need to write some code for your pixel shader to ...


1

Changing color to a texture with an effect file can be done in this way: HLSL CODE And then a simple test game: VertexBuffer bufferVertex; IndexBuffer bufferIndex; Effect effect; Matrix View, Projection; protected override void LoadContent() { effect = Content.Load<Effect>("Color"); Projection = ...


1

Correct me if I wrong, but it looks like you are trying to mimic the BasicEffect shader code into your own shader file. Microsoft's App Hub provides code for BasicEffect: http://xbox.create.msdn.com/en-US/education/catalog/sample/stock_effects From there you can extract what you need, keep in mind that this will be cumbersome as BasicEffect encapsulates a ...


1

Effect has Techniques that tells you what vertex shader and pixel shader to use In your .fx file you will have 1 vertex shader and 2 pixel shader functions, and two techniques technique Colored { pass Pass0 { VertexShader = compile vs_2_0 VertexShaderFunction(); PixelShader = compile ps_2_0 ColoredPixelShader(); } } ...


1

I would guess that the problems is with the UV mapping. Is your texture mapping in blender set to UV with the correct map? When blender export FBX it uses the txt version of FBX (not the binary one). Try to open open the FBX file in a text editor to see if something looks wierd (if the UVs or Normals are all zeros)


1

All you need to do is set a new RasterizerState object on your GraphicsDevice that specifies wireframe (or not). Specifically to accomplish what you're trying to do here are the steps: Draw your vertex buffer with depth & depth write enabled and filled shading On your GraphicsDevice object set a new RasterizerState that specifies wireframe and a new ...



Only top voted, non community-wiki answers of a minimum length are eligible