dxEntityShininess(entity%,shininess#)

Parameters

Entity - entity handle
Shininess# - shininess of entity

Description

Sets the specular shininess of an entity.

The shininess# value should be a floting point number in the range 0-1. The default shininess setting is 0.

Shininess is how much brighter certain areas of an object will appear to be when a light is shone directly at them.

Setting a shininess value of 1 for a medium to high poly sphere, combined with the creation of a light shining in the direction of it, will give it the appearance of a shiny snooker ball.

Example

; dxEntityShininess Example
; -----------------------

dxGraphics3D 640,480
dxSetBuffer dxBackBuffer()
camera=dxCreateCamera()
; Set ambient light to a low level, to increase effect of shininess

dxAmbientLight 32,32,32
light=dxCreateLight()
dxRotateEntity light,45,45,0

sphere=dxCreateSphere(100)
dxEntityColor Sphere,255,0,0
dxPositionEntity sphere,0,0,4

; Set initial shine value

shine#=0

While Not dxKeyDown(1)
; Change shine value depending on key pressed

If dxKeyDown(2)=True And shine#>0 Then shine#=shine#-0.01
If dxKeyDown(3)=True And shine#<1 Then shine#=shine#+0.01

; Set entity shininess using shine value
dxEntityShininess sphere,shine#

dxRenderWorld

dxText 0,0,"Press keys 1-2 to change dxEntityShininess Setting"
dxText 0,20,"Entity Shininess: "+shine#

dxFlip
Wend
End

Index