News:

Function Finder  Find all the functions within source code files

Main Menu

Lightimage

Started by stef, September 03, 2006, 02:10:38 AM

Previous topic - Next topic

stef

Hi!

It seems that command "lightimage" in fullscreenmode,16 bit doesn't work correctly.


; ==================
;  LightIMage
; ==================
  OpenScreen 800,600,16,2
; Create a image using the Ball and size variables
  Size=255
  CreateImage 1,Size,Size
  RenderToImage 1
  Cls RndRGB()
 
; Draw some random stuff on the image
  For lp =0 To 10
     CircleC Rnd(size),Rnd(size),RndRange(5,10),1,RndRGB()
  Next
 
; Copy the image
  CopyImage 1,2
 
; Direct all draw to the screen
  RenderToScreen
  Cls RGB(25,30,40)
 
  X=140
  y=100
 
; Draw the original image
  Text x,y,"original image"
  DrawImage 1,x,y+20,1
 
; Draw the second copy of image shaded.
  Text x+size+10,y,"Shaded Image"
  LightImage 2,Size/2,size/2,200,1
  DrawImage 2,x+size+10,y+20,1
 
 
; Display the Screen and wait for key to be pressed
  Sync
  WaitKey



kevin

 Works correctly here.

Run this on your computer and tell me depth it gets for your machine.

 
; Note: this demo opens a 32bit screen mode.
  Openscreen  800,600,16,2
 
  Cls 255
  w=200
  h=400
  img =1

  CreateFXImage Img,w,h
 
  c1=$ff0000
  c2=$00ff00
  c3=$0000ff
  RenderToImage 1
 
  For lp=0 To 100
     x1=Rnd(w)
     y1=Rnd(h)
     x2=Rnd(w)
     y2=Rnd(h)
     x3=Rnd(w)
     y3=Rnd(h)
     GouraudTri x1,y1,c1,x2,y2,c2,x3,y3,c3
  Next
 
  RenderToScreen
     x=100
     y=10
     DrawImage img,x,y,0
     Text x,y,Str$(GetImageDepth(img))+" bit"
 
; display screen and wait for a key to be pressed
  Sync
  WaitKey

stef


the depth is 16 bits

But what I meant is that "lightimage" is making visible steps ( you can't use it that way).
But maybe that effect isn't to avoid (in 16 bit fullscreen)


stef

kevin


  sigh.  15/16bit modes don't have the colour range to display finer steps.