[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]


  • Страница 1 из 1
  • 1
Модератор форума: Spidy, turBO, blitz3d  
Форум мира Blitz3D » Язык Blitz3D » 3D программирование » Motion Blur
Motion Blur
deejexДата: Пятница, 17.07.2009, 20:26 | Сообщение # 1
заядлый прогер
Группа: Пользователи
Сообщений: 522
Награды: 2
Репутация: 14
Статус: Offline
Инит (с установкой граф. режима):
Code

Global gr_width=800
Global gr_height=600
Global gr_depth=32
Global gr_mode=1
Global mb_frames=7
Global mb_delay=200
Graphics3D gr_width,gr_height,gr_depth,gr_mode
Global camera_main = CreateCamera()
Global mb_spr = CreateCameraSprite(CAMERA)
Global mb_tex = CreateTexture(gr_width,gr_height,2,mb_frames)
TextureBlend mb_tex,3
For mb_templare1 = 0 To mb_frames-1
EntityTexture mb_spr,mb_tex,mb_templare,mb_templare
Next  
Global mb_oldtime

CreateCameraSprite(camera):
Code
Function CreateCameraSprite(camera)
temp_s = CreateSprite(camera)
PositionEntity temp_s,EntityX(camera),EntityY(camera),EntityZ(camera)
If GraphicsWidth()=640 And GraphicsHeight()=480 Then
ScaleSprite temp_s,.0999,.075
End If
If GraphicsWidth()=800 And GraphicsHeight()=600 Then
ScaleSprite temp_s,.0999,.075
End If  
If GraphicsWidth()=1024 And GraphicsHeight()=768 Then
ScaleSprite temp_s,.0999,.075
End If
If GraphicsWidth()=1152 And GraphicsHeight()=864 Then
ScaleSprite temp_s,.0999,.075
End If
If GraphicsWidth()=1280 And GraphicsHeight()=720 Then
ScaleSprite temp_s,.0999,.056
End If
If GraphicsWidth()=1280 And GraphicsHeight()=768 Then
ScaleSprite temp_s,.0999,.06
End If
If GraphicsWidth()=1280 And GraphicsHeight()=800 Then
ScaleSprite temp_s,.0999,.063
End If
If GraphicsWidth()=1280 And GraphicsHeight()=960 Then
ScaleSprite temp_s,.0999,.075
End If
If GraphicsWidth()=1280 And GraphicsHeight()=1024 Then
ScaleSprite temp_s,.0999,.08
End If
RotateEntity temp_s,EntityPitch(camera),EntityYaw(camera),EntityRoll(camera)
TranslateEntity temp_s,0,0,.1,0
Return temp_s
End Function

MotionBlur():
Code
Function MotionBlur()
If MilliSecs()-mb_oldtime>mb_delay Then
mb_oldtime = MilliSecs()
For temp = 0 To mb_frames-2
CopyRect 0,0,gr_width,gr_height,0,0,TextureBuffer(mb_tex,temp),TextureBuffer(mb_tex,temp-1)
Next  
CopyRect 0,0,gr_width,gr_height,0,0,BackBuffer(),TextureBuffer(mb_tex,0)
End If
End Function

Функция MotionBlur должна устанавливаться после Flip.
После первого переброса вылетает Memory Acess Volation.
В чем же дело?




 
blitz3dДата: Пятница, 17.07.2009, 21:20 | Сообщение # 2
Admin
Группа: Администраторы
Сообщений: 203
Награды: 3
Репутация: 7
Статус: Offline
У тебя происходит вылет из-за отсутствия объекта camera - он нигде не фигурирует. Мне кажется следует заменить эту строку:

Code
Global camera_main = CreateCamera()

на эту:

Code
Global camera = CreateCamera()

Попробуй!


перед тобой две таблетки - красная и синяя - какую ты выберешь?
 
deejexДата: Пятница, 17.07.2009, 21:32 | Сообщение # 3
заядлый прогер
Группа: Пользователи
Сообщений: 522
Награды: 2
Репутация: 14
Статус: Offline
Нет, вылет идёт после первого изменения текстур камерного спрайта



 
Форум мира Blitz3D » Язык Blitz3D » 3D программирование » Motion Blur
  • Страница 1 из 1
  • 1
Поиск: