Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Игры";
Текущий архив: 2005.12.18;
Скачать: [xml.tar.bz2];

Вниз

GLScene тени   Найти похожие ветки 

 
nikolya   (2005-05-05 20:59) [0]

Случилась у меня такая проблема: При загрузке 3ds файла на него не действуют источники света - теней просто нет. Не знаете как с этим справиться?


 
DeadMeat ©   (2005-05-05 22:34) [1]

Так не действуют источники света или теней нету?
Это не одно и тоже...

---
...Death Is Only The Begining...


 
Домовенок ©   (2005-05-06 05:29) [2]

Так же если на загруженную модель тянется текстура, то нужно убедится что в свойствах текстуры TextureMode = tmModulate (по умолчанию стоит tmDecal).


 
Xeno ©   (2005-05-06 06:18) [3]

Чем пользуешься для создания теней, если GLScene то TGLShadowPlane,TGLZShadows,TGLShadowVolume или на всё API?


 
mgant89   (2005-07-25 21:57) [4]

Как пользоватся TGLZShadows.
Если ктонить знает где находится какиенить доки по TGLZShadows дайте ссыли
или
пример с приминением TGLZShadows


 
Санёк   (2005-07-25 23:08) [5]

присовокуплю сюда свой вопрос про тени:
у меня они реализованы на TGLShadowVolume.
на моем мобильном радике 9700про все работает как надо.
проверял у друга на FX5700 с какими-то странными дровами от асуса - теней нет. при этом приложение не вылетает и закрывается штатно.
можно ли отловить наличие или отсутствие теней и выводить на это какое-нить сообщение?
ну что-то типа


try
GLShadowVolume1.Active:=True;
except
ShowMessage("Тени недоступны");
end;


 
Санёк   (2005-07-25 23:11) [6]


> mgant89   (25.07.05 21:57) [4]


про это есть в примерах.

вот из ридми:

Z-Shadows for GLScene
----------------------
Rene Lindsay
22 October 2001

Overview
---------
This component is an extention to Eric Grange"s excelent GLScene OpenGL Library,
which is based on the original GLScene library by Mike Lischke.
It allows any visible objects in the scene to cast shadows, using the Z-Buffer method.
Any visible object casts shadows onto any other objects, and even onto itself.
The shadows are NOT pre-calculated. They are dynamically calculated, in Real-time.
So, when an object is moved, or animated, its shadow moves with it.
I did NOT use GeForce extentions, so it will work on older Graphics controllers.

How to Install
---------------
This component was writen to work with the October CVS version of GLScene 0.8.3.
The component consists of 2 files:
GLzBuffer.pas
GLzBuffer.dcr

Copy these 2 files to the GLScene\Source directory.

Open GLScene\Source\DesignTime\GLSceneRegister.pas, and make the following 2 changes.
1) Add GLzBuffer to the Uses clause at line 125.
2) Register the shadow object into the GLScene IDE, by adding the following line to the
  end of the file (line 1335)
  RegisterSceneObject(TZShadows, "Shadows", "");
Save this file.

Open GLScene\Delphi5\GLScene.dpk, and add the unit to GLScene package.
Click the Compile button, and save.

The Shadow object will now be available in the TGLScene object menu.

How to use
-----------
The Shadow object uses a second camera as a lightsource, via a TGLMemoryViewer object.
So, you need 2 camera objects. Link the GLSceneViewer to one camera, and
link a TGLMemoryViewer to the other camera.
Add the shadow object to the end of your GLScene tree.
Link it to the TGLSceneViewer, and the TGLMemoryViewer.

At Runtime, you need to call ZShadows1.CastShadow,
to recaclulate the shadows, every time an object is moved.
(Do not refresh the MemoryViewer directly, because then the
shadow-object wont fecth the z-buffer.)

How it works
------------
The second camera, which is linked to the TGLMemoryViewer acts as the
Lightsource Point Of view (pov).
Any object that is visible from the lightsource, is in direct light.
Anything not directly visible for the lightsource, is in shadow.

More details of how it works
----------------------------
1: When you call the shadow object"s CastShadow method, the scene is rendered
  from the lightsource pov, and its z-buffer (depth buffer) is grabbed.
2: The scene is rendered from the main camera, to the point where the
  TZShadows object is placed in the scene tree.
3: At this point, the Main scene"s z-buffer is grabbed.
  Every rendered pixel"s world coordinate(x,y,z) is then calculated, by using
  the pixel"s vector, and z-buffer depth.
4: The program then calculates at which pixel on the lightsource view this
  world coordinate would be drawn, and its z-distance from the lightsource.
  If this z-distance matches the actual z-distance of that pixel, then
  that pixel is in direct light.
  If the coordinate"s distance is greater than the rendered z-value, then
  something is obscuring that pixel, and it is in shadow.
5: Shadowed pixels on the main view, are drawn to a texture.
6: The shadow textute is overlayed onto the scene,
  like a semi-transparent HUD-Sprite.

Properties and Methods
----------------------
Method:
CastShadow: VERY INPORTANT!
 Used to grab the z-buffer from the lightsource pov.
 Call this every time any object(besides the main camera) moves.
Properties
Caster: Specifies Lightsource TGLMemoryView object
Viewer: Specifies Main View TGLSceneViewer object
Soft:  Gives shadows soft edges, by sampling 4 pixels on the lightsource z-buffer
Optimise: Speeds up the shadow-map generation, by skipping pixels when testing for
 shadows. It ocasionally makes mistakes jumps over very thin shadows, or light beams.
 In places where shadow edges are detected, it falls back
 to testing every pixel. In theory, "op16in1" is the fastest.
XRes, YRes: Specify the resolution of the shadow map.
 Smaller sizes run faster, but cause edges to look blocky
Tolerance: Specify the tolerance between the z-value and lightsource distance.
 Too small values cause ugly dot patterns, caused when surfaces
 casts shadows onto itself, due to small inaduracies in calculations.
 Too large values cause light to shine too far through a surface.
DepthFade: Causes the brightness of the lightsource to fade with distance.
 For now, this uses linear fading, just like the fog-algorythm.
 A Spherical mapping will be added in a future version, which
 is more realistic, but also slower.
FrustShadow: Specify if the area outside the lightsource view frustrum is in shadow, or light.

Please send any comments to: rjklindsay@hotmail.com


а сама демка вот отсюда GLScene\Demos\specialsFX\shadows



Страницы: 1 вся ветка

Форум: "Игры";
Текущий архив: 2005.12.18;
Скачать: [xml.tar.bz2];

Наверх




Память: 0.47 MB
Время: 0.017 c
14-1132829394
Урий
2005-11-24 13:49
2005.12.18
Quake 4


2-1133437835
s77
2005-12-01 14:50
2005.12.18
создание указателя на объект


8-1121267512
Igor_thief
2005-07-13 19:11
2005.12.18
Работа с png изображениями?


1-1132905488
remlin
2005-11-25 10:58
2005.12.18
Программное выделение ячеек StringGrid


14-1132824008
Сержо
2005-11-24 12:20
2005.12.18
JavaScript: Перенос опций из одного select а в другой





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский