Hello folks,
I'm new to DGDK and have been working about a week on a space game. Fairly happy with the results, especially as a first go at graphics programming. Thanks to everyone's posts getting me this far....
So I managed to get a sun with a corona, using a bloom camera. But I'm getting three wierd effects. First, I can't change the color. Have no idea why. Second, there's this triangle lens-distortion. Finally, attempts to rotate the star merely removes it altogether.
I know I've done *something* wrong, just don't know what. Any ideas?
-Jason
// make a sphere
dbMakeObjectSphere ( OBJ_SINGLE_STAR, size, 50, 50 );
dbScaleObject (OBJ_SINGLE_STAR, 100, 100, 100);
dbSetObjectSmoothing(OBJ_SINGLE_STAR,100);
dbPositionObject ( OBJ_SINGLE_STAR, xLoc, yLoc, zLoc); // position the object at center
dbSetObjectLight(OBJ_SINGLE_STAR,0); // Uniform lighting
dbColorObject ( OBJ_SINGLE_STAR, dbRgb(colorR,colorG,colorB)); // based on sType: TBD-- COLOR NOT WORKING :(
dbTextureObject ( OBJ_SINGLE_STAR, IMG_STAR_DEFAULT );
// let there be light!!!
dbMakeLight(LIGHT_SUN);
dbSetPointLight(LIGHT_SUN, xLoc,yLoc,zLoc);
dbFadeObject(OBJ_SINGLE_STAR, 200);
dbSetObjectSmoothing(OBJ_SINGLE_STAR,100);
dbSetObjectEmissive (OBJ_SINGLE_STAR,255);
dbSetLightRange(CAM_DEFAULT, brightness);
// increase specular power
dbSetObjectSpecularPower (OBJ_SINGLE_STAR, 255 );
// turn on ambient lighting for this object
dbSetObjectAmbient (OBJ_SINGLE_STAR, 1);
// bloom effect requires additional camera
dbMakeCamera ( CAM_BLOOM_SS );
dbSetCameraRange (CAM_BLOOM_SS,0.1,50000);
dbColorBackdrop ( CAM_BLOOM_SS, 0 );
dbLoadCameraEffect ( "Media\\Bloom.dbs", 1, 0 );
dbSetCameraEffect ( CAM_BLOOM_SS, 1, OBJ_SINGLE_STAR );
dbMakeObjectPlane ( CAM_PLANE_SS, 2, 2 );
dbLoadEffect ( "Media\\quad.fx", 2, 0 );
dbSetObjectEffect ( CAM_PLANE_SS, 2 );
dbMakeVector4 ( 1 );
dbSetVector4 ( 1, dbScreenWidth ( ), dbScreenHeight ( ), 0, 0 );
dbSetEffectConstantVector ( CAM_BLOOM_SS, "ViewSize", 1 );
dbDeleteVector4 ( 1 );
dbTextureObject ( CAM_PLANE_SS, 0, OBJ_SINGLE_STAR );