Smoke:
* Introduce a better check for fragment support
This commit is contained in:
		@@ -5360,7 +5360,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
 | 
			
		||||
		{
 | 
			
		||||
			if(!smd->domain->wt || !(smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG))
 | 
			
		||||
			{
 | 
			
		||||
// #if0
 | 
			
		||||
// #if 0
 | 
			
		||||
				smd->domain->tex = NULL;
 | 
			
		||||
				GPU_create_smoke(smd, 0);
 | 
			
		||||
				draw_volume(scene, ar, v3d, base, smd->domain->tex, smd->domain->p0, smd->domain->p1, smd->domain->res, smd->domain->dx, smd->domain->tex_shadow);
 | 
			
		||||
@@ -5395,7 +5395,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
 | 
			
		||||
						tmp[0] += smd->domain->dx * x + smd->domain->dx * 0.5;
 | 
			
		||||
						tmp[1] += smd->domain->dx * y + smd->domain->dx * 0.5;
 | 
			
		||||
						tmp[2] += smd->domain->dx * z + smd->domain->dx * 0.5;
 | 
			
		||||
						color[0] = color[1] = color[2] = 1.0; // density[index];
 | 
			
		||||
						color[0] = color[1] = color[2] = density[index];
 | 
			
		||||
						glColor3fv(color);
 | 
			
		||||
						bglVertex3fv(tmp);
 | 
			
		||||
					}
 | 
			
		||||
 
 | 
			
		||||
@@ -328,10 +328,10 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture
 | 
			
		||||
 | 
			
		||||
	// printf("i: %d\n", i);
 | 
			
		||||
 | 
			
		||||
	if(GLEW_ARB_fragment_program)
 | 
			
		||||
	 if (GL_TRUE == glewIsSupported("GL_ARB_fragment_program"))
 | 
			
		||||
	{
 | 
			
		||||
		glGenProgramsARB(1, &prog);
 | 
			
		||||
		glEnable(GL_FRAGMENT_PROGRAM_ARB);
 | 
			
		||||
		glGenProgramsARB(1, &prog);
 | 
			
		||||
 | 
			
		||||
		glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, prog);
 | 
			
		||||
		glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, (GLsizei)strlen(text), text);
 | 
			
		||||
@@ -342,7 +342,7 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture
 | 
			
		||||
		glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, 7.0, 7.0, 7.0, 1.0);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
		printf("Your gfx card does not support 3dview smoke drawing.");
 | 
			
		||||
		printf("Your gfx card does not support 3dview smoke drawing.\n");
 | 
			
		||||
 | 
			
		||||
	GPU_texture_bind(tex, 0);
 | 
			
		||||
	if(tex_shadow)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user