Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#ActualMigi0027

Posted 08 October 2013 - 11:19 PM

Alright, I boiled the issue down, and it seemed to be an external issue (Sorry about that).

 

It seems to happen when sampling a texture in a loop (I've done it before, so I don't know why it should cause problems):

float4 textureDistorted(
	float2 texcoord, 
	float2 direction,
	float3 distortion 
) {
	return float4(
		t_dff.Sample(ss, texcoord + direction * distortion.r).r,
		t_dff.Sample(ss, texcoord + direction * distortion.g).g,
		t_dff.Sample(ss, texcoord + direction * distortion.b).b,
		1.0
	);
}
.......
for (int i = 0; i < uSamples; ++i) { // PS. the uSamples is a constant in the shader, so it should unroll the loop
	float2 offset = frac(texcoord + ghostVec * float(i));
		
	float weight = length(float2(0.5, 0.5) - offset) / length(float2(0.5, 0.5));
	weight = pow(1.0 - weight, 10.0);
	
	result += textureDistorted(
		offset,
		normalize(ghostVec),
		distortion
	) * weight; // <- If this command is removed (the textureDistorted), my driver doesn't crash. Though I can use it outside a loop...
}

-MIGI0027

Heh, the topic kind of changed here, just tell me if you see something terribly wrong here.


#1Migi0027

Posted 08 October 2013 - 11:18 PM

Alright, I boiled the issue down, and it seemed to be an external issue (Sorry about that).

 

It seems to happen when sampling a texture in a loop (I've done it before, so I don't know why it should cause problems):

float4 textureDistorted(
	float2 texcoord, 
	float2 direction,
	float3 distortion 
) {
	return float4(
		t_dff.Sample(ss, texcoord + direction * distortion.r).r,
		t_dff.Sample(ss, texcoord + direction * distortion.g).g,
		t_dff.Sample(ss, texcoord + direction * distortion.b).b,
		1.0
	);
}
.......
for (int i = 0; i < uSamples; ++i) {
	float2 offset = frac(texcoord + ghostVec * float(i));
		
	float weight = length(float2(0.5, 0.5) - offset) / length(float2(0.5, 0.5));
	weight = pow(1.0 - weight, 10.0);
	
	result += textureDistorted(
		offset,
		normalize(ghostVec),
		distortion
	) * weight; // <- If this command is removed (the textureDistorted), my driver doesn't crash. Though I can use it outside a loop...
}

-MIGI0027

Heh, the topic kind of changed here, just tell me if you see something terribly wrong here.


PARTNERS