Reflections with bump

Blitz3D Forums/Blitz3D Programming/Reflections with bump

MikhailV(Posted 2008) [#1]
Pleased to present small demo to subjects "How do reflection on floors and walls".

Screenshot:


Demo with source-files:
http://www.fastlibs.com/temp/demo.zip (1.2 Mb)

p.s. I do this for two render, since is impossible use cubemap with bump (not work on NVidia videocards). First render in small texture and occupies much little time (don't eat FPS).


SabataRH(Posted 2008) [#2]
Excellent, does fastextension still offer the blitzuser coupon? Thats a really nice library you got going there.


MikhailV(Posted 2008) [#3]
@Swampdonkey: Yes, you can use coupon for discount.

I can tell in detail about technology, which is used in demo.
Apropos, this technology is used in many games.


John Blackledge(Posted 2008) [#4]
Mikhail, your work in extending DirectX7 for Blitz3D is very appreciated by this community.


t3K|Mac(Posted 2008) [#5]
i think i have to switch to fastlibs... looks good!


Mortiis(Posted 2008) [#6]
Mikhail, your work in extending DirectX7 for Blitz3D is very appreciated by this community.


Totally agreed! +1


Naughty Alien(Posted 2008) [#7]
..problem i see here is use for non symetrical objects(since its prerendered reflection texture)..other than that, its nice...


MikhailV(Posted 2008) [#8]
Symmetry does not matter :)
Simply this method more whole suits for closed space - for each room possible to create pre-rendered cubemap and use it for reflection. This method is used in HL2 engine (is it only made on shaders).


Naughty Alien(Posted 2008) [#9]
hey Mikhail..but how to render appropriate reflection map for environment such as caves and in very curved shape? Reflection map is not updated realtime, right?? So how to render out such reflection map?


Naughty Alien(Posted 2008) [#10]
..is it better to make copy of existing mesh and then render very small reflection map over it with added bumpmap and set transparency for it??


MikhailV(Posted 2008) [#11]
No, you has not understood, all more simply than you think.
It's 'fake' reflections and is not required high quality and persisting reflections — not seen difference! (only experienced programmer can notice differences). Attentively see HL2 game or CounterStrike (or other games based on this method) — reflections on floors and walls look fine, but this too 'fake' !

p.s. You can render environment to cubemap texture each frame, but this unnecessary. Enough single pre-rendered cubemap for each sector (room)!


Naughty Alien(Posted 2008) [#12]
I do understand that Mikhail..but if you notice, when i move left within room(demo you provided) its easy to see that shine part goes away from open door..i know its fake so its fine..but for my caves with multiple torches, not work well..i mean..only fake version


SabataRH(Posted 2008) [#13]
Excellent, just aquired this wonderful blitz3d addon.. and thanks for the coupon! :)


Ross C(Posted 2008) [#14]
Nice, i've been waiting on this!


Kryzon(Posted 2008) [#15]
Hey MikhailV, do you know if it is possible to use HLSL shaders on Blitz3D, through a wrapper maybe?


_33(Posted 2008) [#16]
At least 50 blitzers will tell you that it's not possible rafael_blitz :)

1) Blitz3D uses Direct X 7 api
2) HLSL is for OpenGL
3) There are no packages around that let us use shaders in Blitz3D


Kryzon(Posted 2008) [#17]
Er, no, HLSL is for DirectX. Taken from wikipedia:

In Direct3D, shaders are programmed with High Level Shader Language, or HLSL, but the types and complexity of shader programs allowed differ depending on what version of Direct3D is used.


Still, we are left out with the DirectX 7 API. I wonder what MikhailV is using to do those effects. Maybe the rest of the D3D 7's library?


Tab(Posted 2008) [#18]
	; render reflection-meshes only to small texture
		SetBuffer TextureBuffer (texReflect)
		CameraViewport cam, 0, 0, TextureWidth(texReflect), TextureHeight(texReflect)
		ShowEntity pReflect
			RenderEntity pReflect,cam,1,2
		HideEntity pReflect

	
	; render main scene (without reflection-meshes)
		SetBuffer BackBuffer()
		CameraViewport cam, 0, 0, GraphicsWidth(), GraphicsHeight()
		ShowEntity pNormal
		RenderWorld


RenderEntity is faster than 2 full renders..... only have a problem with the z-order on alpha entities... but, is pretty simple to fix. D:


MikhailV(Posted 2008) [#19]
@Tab: Great! Thanks :)

@rafael_blitz: DirectX7 not support shaders. It's new blend modes only!


Moraldi(Posted 2008) [#20]
Sorry for this stupid and late question, but where are the references of materials box.jpg, floor.jpg etc.?