Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.

Kjell Andersson

Member Since 28 Nov 1999
Offline Last Active Nov 25 2014 11:18 AM

Topics I've Started

Caustics Generator 3.10

07 September 2014 - 07:22 AM

Caustics Generator 3.10 has been released.


New features
  • Shortcut commands for common operations such as Render Frame etc.
  • Reset button for parameters that return them to default state.
  • Mouse wheel can be used to zoom in preview window.

About program

Caustics Generator is a program for rendering light textures that simulate the light refractions you see at the bottom of a pool on a sunny day.

The rendered textures can be horizontally and vertically tiled and animated as a looping sequence.


More information and download



Tug of Magic

07 August 2014 - 01:51 PM

Just finished and released my latest game on Android.






Do you have any experience on how long it takes before it gets searchable in the Google Play store?

It's been more than 24h now and it can still not be found via search.

Caustics Generator 3.9

17 January 2014 - 12:19 PM

Caustics Generator Pro 3.9 has been released.

New in this version is output of the animated water surface as a normal map.
Since the water surface is horizontally and vertically tileable and also seamlessly loops in time it is ideal
for use as an input texture to your water surface shader.

This is an example of a generated normal map:



You can find out more about Caustics Generator at http://www.dualheights.se/caustics



04 November 2013 - 11:09 AM

When running some D3D11 code on a virtual machine I get the following error:


D3D11 ERROR: ID3D11Device::CreateSamplerState: CreateSampler: Border addressing mode not supported at this feature level. [ STATE_CREATION ERROR #1048635: CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED]


Using CLAMP mode instead of BORDER makes the application work, but I was a bit confused when seeing that BORDER is not always a supported feature. I can't see anything about border in the following Direct3D feature level chart:




I wasn't requesting any particular feature level (passing pFeatureLevels=NULL to D3D11CreateDevice) so I can't tell what "this" is referring to in the above error message.


Is missing border mode addressing something that one should worry about or is it just an anomaly of the virtual machine?


Porting D3DXLoadSurfaceFromSurface

16 October 2013 - 11:15 AM

I'm trying to get out of using D3DX since it is deprecated as of the Windows 8 SDK.

My application is DirectX 9 x64 and I have tried replacing a call to D3DXLoadSurfaceFromSurface() with StretchRect() or UpdateSurface() without any luck. The result is always a failed HRESULT.


What I'm trying to do is copy data from a surface into a texture that can be used for rendering onto a quad using DrawPrimitiveUP().


Does anyone know how D3DXLoadSurfaceFromSurface() is implemented behind the scenes, since it seems to be able to copy data between my surfaces?



Below is the code snippet in which I would like to replace D3DXLoadSurfaceFromSurface. A general discussion on better ways to implement this is also welcome.

void OnNewSurfaceArrived(IDirect3DSurface9 *pSurface)
	D3DSURFACE_DESC surfaceDesc;
	if (m_pTexture == NULL) {
		m_pDevice->CreateTexture(surfaceDesc.Width, surfaceDesc.Height, 1, surfaceDesc.Usage, surfaceDesc.Format, D3DPOOL_DEFAULT, &m_pTexture, NULL);
		m_pTexture->GetSurfaceLevel(0, &pTextureSurface);
	D3DXLoadSurfaceFromSurface(pTextureSurface, NULL, NULL, pSurface, NULL, NULL, D3DX_DEFAULT, 0);


	  float x, y, z, rhw;
	  FLOAT tu, tv;
	UINT x = 0;
	UINT y = 0;
	UINT w = m_d3dpp.BackBufferWidth;
	UINT h = m_d3dpp.BackBufferHeight;
	D3DTLVERTEX qV[4] = {
		{ (float)x,	(float)(y+h),	0.0f, 1.0f,	0.0, 1.0},
		{ (float)x,	(float)y ,	0.0f, 1.0f,	0.0, 0.0},
		{ (float)(x+w),	(float)(y+h),	0.0f, 1.0f,	1.0, 1.0},
		{ (float)(x+w),	(float)y,	0.0f, 1.0f,	1.0, 0.0}
	m_pDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_TEX1);
	m_pDevice->SetTexture(0, m_pTexture);
	m_pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, qV, sizeof(D3DTLVERTEX));

	m_pDevice->Present(NULL, NULL, NULL, NULL);