Shadow volume
Blitz3D Forums/Blitz3D Programming/Shadow volume
| ||
This demo is created for simulate the volume shadow shipment the code in order to test it and hoping that you can help me to improve it hello excuse for the my english http://digilander.libero.it/enzo_light/shw.zip ![]() |
| ||
Where to start.... 1. You're referencing several include files which the rest of us don't have. [edit] I found one of them hidden in the above 'mess'. See point 3 below. 2. You're loading models and textures that the rest of us don't have. 3. Your code is not indented and is nigh on impossible to read. At LEAST put it in code tags. People simply cannot be bothered messing about getting your code to run. Post a downloadable demo with EXE/ZIP file, and possibly a screenshot as well, and you might get people interested. |
| ||
or better still codebox tags. |
| ||
Vincenzo, Use "[code] ...your code goes here... [\code]" to show your code - Oh but ignore the " ". IPete2. |
| ||
or codebox, it's much better for lots of long code. |
| ||
Ok!!! Bye |
| ||
Ran the EXE - Memory Access Violation. Your code gives the same error at "WritePixelFast X,Y,0", in Function ShadowVolumeCreateImage() |
| ||
? |
| ||
you have got the same problem as i have...did u read my thread about stencil shadow volumes? if not, this would be helpful at all :) |
| ||
i ha a simulate stencil buffer :D this is a very slow speed :( help me for speed up bye |
| ||
yes, i will check the code out when i come back from my holiday trip in a few days... |
| ||
i have changed the code function ShadowVolumeCreate3$ for speed up, imcrements 16 milliseconds bye post a new code |
| ||
ok, i can help you(i have got the same problem as you!) if you help me to find the function in that code which creates the volume and isolate it, i can help you to create a good stencil shadow system! so where is the function which creates the volume? edit: i found some things about the volume, but it is to slow for a real shadow system, and i can't really isolate the function from the rest(from the rubbish) |
| ||
the function for create volume is the last function posted ShadowVolumeCreate3$(...) this function is composed the 2 section 1° section: acquire vertex transformed, selected vertex front side light, and defined edge triangle 2° section: discard edge equal and create volume object other adge the funtion is indipendent to the system i have a idea.... InitShadow this function acquire vertex object first and precessed vertex(in the memory) post for volume, this system increment speed 2 - 10% the very problem is generate ShadowVolumeCreateImage this funcion create slow speed for 2 read pixel(back and front face object volume) and 1 write pixel, this function simulate stencil congratulation!! the your system render is very good speed excuse for the my english Thank's for all bye |
| ||
but why is this thingy so slowly? i think it is thew volume create function which is so slowly... so i cannot use it for my system sry :( |
| ||
? test the your system disabled the creation volume or system simulate stencil |
| ||
ok, i found the function which lames all down, now i'm making a system out of this... if it works(IF IT WORKS) i will send it to u :) edit: your source is 1200 lines large. i'm modifying it, and now it's only 250 lines long, how could this be?? - half of ypur code is rubish! |
| ||
i send a link new version simplex ;) i have divide common and shadow digilander.libero.it/enzo_light/shw01.zip |
| ||
there is nothing changed, but i'll try to make the best of both :) |
| ||
i search the new alghoritm for generate silhouette bye |
| ||
i have modifyed you one up to this:Graphics3D 1024, 768, 32, 2 SetBuffer BackBuffer() ;Globs Global sh_v1.Point3D, sh_v2.Point3D, sh_v3.Point3D, sh_nv1.Point3D, sh_nv2.Point3D, sh_nv3.Point3D, sh_vect1.Point3D, sh_vect2.Point3D, sh_vect3.Point3D, sh_light.Point3D, sh_lenght.Point3D, sh_normal.Point3D, sh_NCamera.Point3D Global VolumeMesh, VolumeSurface Dim Edge.Edge(65000) ;Camera Cam = CreateCamera() ;Shadows InitShadows() ;Floor c = CreateCube() ScaleEntity c, 10, 1, 10 PositionEntity c, 0, -5, 10 EntityColor c, 0, 255, 0 ;Caster Cube = CreateSphere() PositionEntity Cube, -1.5, 0, 10 Cube2 = CreateCube() PositionEntity Cube2, 1.5, 0, 10 ;Light Light = CreateLight() PositionEntity Light, 0, 5, 10 While Not KeyHit(1) ms = ms + 1 PointEntity Light, Cube TurnEntity Cube, 1, .5, 1.5 TurnEntity Cube2, 1, .5, 1.5 ResetShadowVolume() ShadowVolume(Cube, Light) ShadowVolume(Cube2, Light) RenderWorld Flip Wend FreeShadows() End ;Types Type Point3D Field x#, y#, z# End Type Type Edge Field Surf, Triangle Field Point0.Point3D, Point1.Point3D, Ray0.Point3D, Ray1.Point3D End Type Function InitShadows() ;Volume mesh VolumeMesh = CreateMesh() VolumeSurface = CreateSurface(VolumeMesh) EntityAlpha VolumeMesh, .5 EntityColor VolumeMesh, 255, 0, 0 EntityFX VolumeMesh, 17 ;Edges For a = 0 To 65000 Edge.Edge(a) = New Edge Edge(a)\Point0.Point3D = New Point3D Edge(a)\Point1.Point3D = New Point3D Edge(a)\Ray0.Point3D = New Point3D Edge(a)\Ray1.Point3D = New Point3D Next ;Points sh_v1.Point3D = New Point3D sh_v2.Point3D = New Point3D sh_v3.Point3D = New Point3D sh_nv1.Point3D = New Point3D sh_nv2.Point3D = New Point3D sh_nv3.Point3D = New Point3D sh_vect1.Point3D = New Point3D sh_vect2.Point3D = New Point3D sh_vect3.Point3D = New Point3D sh_light.Point3D = New Point3D sh_lenght.Point3D = New Point3D sh_normal.Point3D = New Point3D sh_NCamera.Point3D = New Point3D End Function Function FreeShadows() If VolumeMesh Then FreeEntity VolumeMesh Delete Each Point3D Delete Each Edge End Function Function V3_Inc.Point3D(val1.Point3D, val2.Point3D) val1\x = val1\x + val2\x val1\y = val1\y + val2\y val1\z = val1\z + val2\z Return val1 End Function Function V3_Dec.Point3D(val1.Point3D, val2.Point3D, val3.Point3D) val3\x = val1\x - val2\x val3\y = val1\y - val2\y val3\z = val1\z - val2\z End Function Function V3_Mul.Point3D(val1.Point3D, val2.Point3D) val1\x = val1\x * val2\x val1\y = val1\y * val2\y val1\z = val1\z * val2\z Return val1 End Function Function V3_Copy(a.Point3D, b.Point3D) a\x# = b\x# a\y# = b\y# a\z# = b\z# End Function Function V3_Normalize(val.Point3D) do# = 1.0 / Float(Sqr(val\x ^ 2 + val\y ^ 2 + val\z ^ 2)) val\x = val\x * do val\y = val\y * do val\z = val\z * do End Function Function V3_CheckVertex(a.Point3D, b.Point3D) If a\x = b\x And a\y = b\y And a\z = b\z Then Return True Else Return False End Function Function ResetShadowVolume() ClearSurface VolumeSurface End Function Function ShadowVolume(model, Light) sh_light\x = EntityX(Light) sh_light\y = EntityY(Light) sh_light\z = EntityZ(Light) sh_lenght\x = 1000 sh_lenght\y = 1000 sh_lenght\z = 1000 Norm.Point3D = New Point3D MidPoint.Point3D = New Point3D NormLight.Point3D = New Point3D For n = 1 To CountSurfaces(model) surf = GetSurface(model, n) dwNumFaces = CountTriangles(surf) - 1 For v = 0 To dwNumFaces vert0 = TriangleVertex(surf, v, 0) vert1 = TriangleVertex(surf, v, 1) vert2 = TriangleVertex(surf, v, 2) TFormPoint VertexX(surf, vert0), VertexY(surf, vert0), VertexZ(surf, vert0), model, 0 sh_v1\x = TFormedX() sh_v1\y = TFormedY() sh_v1\z = TFormedZ() TFormPoint VertexX(surf, vert1), VertexY(surf, vert1), VertexZ(surf, vert1), model, 0 sh_v2\x = TFormedX() sh_v2\y = TFormedY() sh_v2\z = TFormedZ() TFormPoint VertexX(surf, vert2), VertexY(surf, vert2), VertexZ(surf, vert2), model, 0 sh_v3\x = TFormedX() sh_v3\y = TFormedY() sh_v3\z = TFormedZ() aa.Point3D = New Point3D bb.Point3D = New Point3D V3_Dec(sh_v3, sh_v2, aa.Point3D) V3_Dec(sh_v2, sh_v1, bb.Point3D) ax# = aa\y# * bb\z# - aa\z# * bb\y# ay# = aa\z# * bb\x# - aa\x# * bb\z# az# = aa\x# * bb\y# - aa\y# * bb\x# Norm\x# = ax# Norm\y# = ay# Norm\z# = az# Delete aa Delete bb MidPoint\x = (sh_v1\x# + sh_v2\x# + sh_v3\x) / 3 MidPoint\y = (sh_v1\y# + sh_v2\y# + sh_v3\y) / 3 MidPoint\z = (sh_v1\z# + sh_v2\z# + sh_v3\z) / 3 V3_Dec(MidPoint, sh_light, NormLight) V3_Normalize(Norm) V3_Normalize(NormLight) Dot# = Norm\x# * NormLight\x# + Norm\y# * NormLight\y# + Norm\z# * NormLight\z# If Dot# => 0 And Dot# <= 1 Then ID_EdgeF.Edge = Edge(CNTFront) ID_EdgeF\Surf = surf ID_EdgeF\Triangle = v V3_Copy(ID_EdgeF\Point0, sh_v1) V3_Copy(ID_EdgeF\Point1, sh_v2) CNTFront = CNTFront + 1 ID_EdgeF.Edge = Edge(CNTFront) ID_EdgeF\Surf = surf ID_EdgeF\Triangle = v V3_Copy(ID_EdgeF\Point0, sh_v2) V3_Copy(ID_EdgeF\Point1, sh_v3) CNTFront = CNTFront + 1 ID_EdgeF.Edge = Edge(CNTFront) ID_EdgeF\Surf = surf ID_EdgeF\Triangle = v V3_Copy(ID_EdgeF\Point0, sh_v3) V3_Copy(ID_EdgeF\Point1, sh_v1) CNTFront = CNTFront + 1 EndIf Next Next cntUguali = 0 cntDiverse = 0 For a = 0 To CNTFront If Edge(a)\surf > 0 Then Diverso = True MemB = 0 ID_EdgeFA.Edge = Edge(a) ID_P0.Point3d = ID_EdgeFA\Point0 ID_P1.Point3d = ID_EdgeFA\Point1 For b = a + 1 To CNTFront ID_EdgeFB.Edge = Edge(b) If Edge(b)\surf > 0 Then check1 = V3_CheckVertex(ID_P0, ID_EdgeFB\Point0) check2 = V3_CheckVertex(ID_P1, ID_EdgeFB\Point1) If check1 And check2 Then MemB = b cntUguali = cntUguali + 1 ID_EdgeFA\surf = 0 ID_EdgeFB\surf = 0 Diverso = False Exit Else check1 = V3_CheckVertex(ID_P0, ID_EdgeFB\Point1) check2 = V3_CheckVertex(ID_P1, ID_EdgeFB\Point0) If check1 And check2 Then MemB = b cntUguali = cntUguali + 1 ID_EdgeFA\surf = 0 ID_EdgeFB\surf = 0 Diverso = False Exit EndIf EndIf EndIf Next If Diverso Then cntDiverse = cntDiverse + 1 V3_Dec(ID_P0, sh_light, ID_EdgeFA\Ray0) V3_Normalize(ID_EdgeFA\Ray0) ID_EdgeFA\Ray0 = V3_Inc(V3_Mul(ID_EdgeFA\Ray0, sh_lenght), ID_P0) V3_Dec(ID_P1, sh_light, ID_EdgeFA\Ray1) V3_Normalize(ID_EdgeFA\Ray1) ID_EdgeFA\Ray1 = V3_Inc(V3_Mul(ID_EdgeFA\Ray1, sh_lenght), ID_P1) va = AddVertex(VolumeSurface, ID_P0\x, ID_P0\y, ID_P0\z) vb = AddVertex(VolumeSurface, ID_EdgeFA\Ray1\x, ID_EdgeFA\Ray1\y, ID_EdgeFA\Ray1\z) AddTriangle(VolumeSurface, va, AddVertex(VolumeSurface, ID_EdgeFA\Ray0\x, ID_EdgeFA\Ray0\y, ID_EdgeFA\Ray0\z), vb) AddTriangle(VolumeSurface, va, vb, AddVertex(VolumeSurface, ID_P1\x, ID_P1\y, ID_P1\z)) ID_EdgeFA\surf = 0 Edge(MemB)\surf = 0 EndIf EndIf Next Delete Norm.Point3D Delete MidPoint.Point3D Delete NormLight.Point3D End Function |
| ||
Devils Child .. now that looks like it's supposed to .. Nice work :) You could get more raw speed by not calling your vector functions in the shadowvolume routine. Also, you create and delete Norm / MidPoint/ NormLight many times - just make them global and don't delete them so that they can be reused. Also in the normalize routine .. it's quicker to use x*x than using x^2. I may have a play around and see if I can be speeded up. So what's the next step? Stevie |
| ||
I Devils Child the your system not have change result, the problem is generate silhouette, i have a solution, have a studi the system for fast silhouette this methods is based for adjacent triangle and a 1 for next (not nested)for generate sil.. I am creating this bye |
| ||
I all this is a link for new systems generate silouette for blitz, is not complete and optimized for my time is little, in order to complete servants the management fines object in sketched part the new optimize are "simulate stencil buffer" is very slow test this software http://digilander.libero.it/enzo_light/shw03.zip bye |
| ||
is the createvolume function of shw03.zip faster than the old one? |
| ||
very very fast!!! i have create a new system for blitz Edge to edge remember? if disable simulate stencil buffer and verify the difference the include is changed :) |
| ||
there is a little bug... if i create a cylinder or a cone, the program crashes... |
| ||
ok lock the program thanks bye |
| ||
The Bug is resolved post the code Bye :) |
| ||
the volume of the cylinder looks a little bit strange... |
| ||
I'd imagine that cylinders and cones may look strange as they use 2 surfaces unlike spheres and cubes. For shadow volume creation you need to combine these surfaces into one. I have a simple function which does this if you want it? Stevie |
| ||
yes, please :) |
| ||
Function MESHsingle( Mesh ) Copy = CreateMesh() ns = CreateSurface( Copy ) For su = 1 To CountSurfaces( Mesh ) s = GetSurface( Mesh , su ) For t = 0 To CountTriangles( s ) - 1 v0 = TriangleVertex( s, t, 0 ) v1 = TriangleVertex( s, t, 1 ) v2 = TriangleVertex( s, t, 2 ) Nv0 = AddVertex( ns , VertexX( s , v0 ) , VertexY( s, v0 ) , VertexZ( s, v0 ) ) Nv1 = AddVertex( ns , VertexX( s , v1 ) , VertexY( s, v1 ) , VertexZ( s, v1 ) ) Nv2 = AddVertex( ns , VertexX( s , v2 ) , VertexY( s, v2 ) , VertexZ( s, v2 ) ) AddTriangle ns , Nv0 , Nv1 , Nv2 Next Next FreeEntity mesh Return Copy End Function Useage .... MyCylinder = MESHsingle( createcylinder() ) You may need to retain the normals but this should be easy to implement. Stevie |
| ||
I *think* CopyMesh attemps to combine surfaces. |
| ||
Doh .. so it does ... Copymesh combines surfaces which share the same brush so logically this works just fine .... why I never thought of that is beyond me ;) So function becomes .. Function MESHsingle( Mesh ) copy = copymesh( Mesh ) freeentity Mesh return copy end function |
| ||
dare devil: with the code of you i cannot make 2 entitys casting a volume!!! there is a bug... edit: ok, but another issue is, that if i take a sphere with 32 segments, the initobject() takes half a minute!? what's about that? can we make it work without long initialization times? |
| ||
i have write a new update for the software, 1° optimize pre load mesh 2° resolved problem object multi surface 3° i ha create a new function simulate stencil 2 fast speed and ...... the inizialize mesh required 5 seconds in released version. The new link a version is: http://digilander.libero.it/enzo_light/shw06.zip for multi object i not have write "for Obj=each..." for test this software. bye |
| ||
ok, i will check it out: ps: look what i have made out of your libary: http://www.blitzbasic.com/gallery/view_pic.php?id=1336&gallery=&page=1 when it's ready it will be FREE* |
| ||
i have look program the different speed is very lot 8 millisecs in the my new systems, and 100 millisecs in the old method from used you. bye |
| ||
well, i see... but...can we make the initobject() time fast AND the shadowvolume() time fast? when we could do this, this would be the best... |
| ||
the init object pre elaborate mesh, not function in real time the IntObject is a system the elaborate edge. the phase 1 is complete ( the bug for 2 object is not resolved generate over face 2 cube ) the Phase 2 is Multi Light Zone, is the system based the lenght light ray all object present in the ray generate volume shadow ;) PS: (in the new demo the system is settings a 256 size texture and not 128) ok bye |
| ||
Hi all post the new update file shadow, i have finished face 1 and start the new section OPTIMIZE InitObject bye size texture 512 ![]() |
| ||
ok, when the initobject() works fast, i will intergrate this code into my stencil shadow system and you'll be the first who will know it :) cya |
| ||
look what i have done with your shadow code: http://patrick-sch.de/bleibdafuerimmer/StencilShadowSystem.zip |
| ||
Good !! the system is good :) bye |
| ||
hm, i get a "too many parameters" error at SetRenderState() |
| ||
t3kMac ..I take it your using at least v1.88? It works fine here ... a few clitches and some slowdown on demo 4. I still don't think it's fast enough for in-game use though :( Max FPS I got on the swwift demo was 60fps but that's without game logic / physics etc.. Your beethoven mesh is nowhere near the same polys as he was pushing. Nice work none the less!! It seems that the shadowvolume creation is still the bottleneck ... if only some smart guy could create a .dll for the volume building then you'd be cooking on gas :) Stevie |
| ||
yes, a volume dll would be revolutionary, because everybody could create his own shadow system, then remember: 90% of the work of a stencil shadow system is the shadow volume! the rest is as easy as clean up his ass :) |
| ||
@stevieg: t3kMac ..I take it your using at least v1.88? i am using blitz 1.96 and hmm don't know the version of dx7test.dll (mine is 77.824 Bytes) maybe i have an old one or old decals... can you send me yours please? |
| ||
@ t3kMac ... I just used the ones which came with the zip download and popped them into the uselibs directory and it worked fine. Stevie |
| ||
Now, get cracking on self shadowing :P Good work guys :o) |
| ||
self shadowing should be simple. You only have to add the caster mesh to the list of the receiver surfaces. One thing that is surely more a candidate for headache is the animated vertices problem. And after all we want to use shadows with characters, right? Adding a pivot to every vertex is also very slow. Additionally there are weighted vertices, so this wouldn't work. Somebody was working on a DLL that was capable of determinating the true vertex coords of animated meshes. Not sure what's going on there. Anyway, good work! |
| ||
@stevie: this dx7 dll looks way older than mine. now i have 3 different dx7.dlls. which one is the best? dx7test.dll DirectX7.dll vardx7.dll little chaos is coming up... |
| ||
directx7.dll is the same as dx7test.dll the name has just changed and i deleted the not-needed functions... ps: daredevil, how is your progress? |
| ||
the my proces is good i have found a litle bug in the initobject, this bug have effect in the load object that contain object null. aptend a new version, what completed this you join the my system your. ok!! bye ;) |
| ||
thanks for the clear up. |
| ||
I have integred your stencil buffer in the my systems is fast !!! :) |
| ||
GOOD! a software stencil buffer is not very useful in games... |
| ||
this is a link http://digilander.libero.it/enzo_light/shw08.zip lock software, the time systems is not correct o stencil buffer hardware has a slow speed is fast the software simulate end not hardware? bye |
| ||
hey, thats not bad...man thats good! :) yes, sure the hardware stencil buffer is faster... but there is a little bug...don't mid, i'll fix it soon! the initobject() takes half a minute in the first sample, and there are >only< 2 spehres with 32 segments... quite to slowly for a real stencil shadow system ;) have you got any idea what we could do? edit: i noticed that you are better in creating volumes, and i am better in making it work with hardware, multilights and so on.. what about, that we could make s shadow system together? then we would be a team for this system! ok? if you have icq or msn, you could give me your icq/msn number and we could chat a lil bit... |
| ||
i'm not use icq :( i have create the system silouette for permit a the new programmers the use software complet and simple that blitzbasic3d. i'm ex programmer professional i have programmed wing commander prophecy for GBA and one part R-Type III by www.raylight.it studios Naples Italy. http://www.mobygames.com/developer/sheet/view/developerId,166785/ The team for shadow? yes!!! the my old team hobby is Eye&Light the link: http://digilander.libero.it/eyeandlight/index.htm bye |
| ||
well, on www.icq.com you can download icq, then you must create an account and in my signature is my icq number, so you can easily find me :) edit: here is OUR worklog :) http://www.blitzbasic.com/logs/userlog.php?user=8270&log=660 |
| ||
i have played arround with shw08 for a few hours and i heve noticed that if you set the m4 mesh as a shadow caster, the shadow of that mesh looks anyhow...strange... |
| ||
Good !! i programmed the silouette in c++ for fast result and return the all ????? bye |
| ||
in c++? well... you may can make a volume dll for blitz, that would be the best :) |
| ||
i have test the limits blitz, is view no screen the problem slow stencil, i have correct common type for max speed, and abjust your stencil sistem, lock gemedev site. The new update: digilander.libero.it/enzo_light/shw09.zip |
| ||
You've got a major memory leak somewhere ... my system ran out of virtual memory after about 5 mins of running the shw example. Was a bugger to close it down. Looks nice though .. assume the low res version is software stencils? Stevie |
| ||
how about making a solution in c++, and making a blitz dll? this would be the fastest solution EVER! |
| ||
Ok new update:D silhouette fast speed up 10% resolved bug in common and general optimizzation . Test this version bye all http://digilander.libero.it/enzo_light/shw10.zip |
| ||
i have checked out the shw10 and there is a critical bug:![]() i don't know how this strip accures...the object has got only one surface. with the m4 model you see those strips, too! |
| ||
I know this bug, but it has not been never resolved!! perhaps the error is caused gives of connected the well faces not caused from the export this bug I have an idea of like resolving it, I will insert a tolerance on you concern to us I have increased of an other 10% the performances of the silouette but it I have not still Posted perhaps why I succeed in 1/2 the speed |
| ||
news: i have checked out the tfp libary from marksibly for tformpoint() commands on animated b3d meshes. but there are too much bugs, so i cannot use it... how is your progress? |
| ||
I got those strips when my quad faces were oriented backwards. Test a third vertex along either of the triangles that make up the edge. Use the orientation of that vertex relative to the plane equation created by the quad to test which direction the quad should face. |
| ||
Geometry is at fault here, not your code! The strip is because the mesh is not a closed mesh. Shadow volumes must be completely closed, or consist of groups of closed meshes. See... ![]() The red and green lines show where an edge is exposed. Idealy, the 'top lip' red edge and the 'mouth cavity' blue edge should be spanned with polys. similarly, the green line should be joint to the lower mouth cavity inside :) |
| ||
Another tip: When you are building the mesh edges, do NOT look for triangles that share vertices. You may have two different vertices in the same position, because of normals or texture mapping. Instead, look for triangles that share vertices that have an identical position. Compare the absolute value of the difference between each component of the vertex positions, and consider them the same if they less than a very small precision value, like 0.001: Function VerticesMatch(surf,a,b) If Abs(VertexX(surf,a)-VertexX(surf,b))<0.001 If Abs(VertexY(surf,a)-VertexY(surf,b))<0.001 If Abs(VertexZ(surf,a)-VertexZ(surf,b))<0.001 Return True Endif Endif Endif End Function |
| ||
Ok!! for you the new update :D the bug face is not resolved is the problem is object :( ok pleace test the new version and check with others object the new step is carmak sistem and multi light range digilander.libero.it/enzo_light/shw11.zip equation plane intersect rect? bye |
| ||
here is the new dll for the stencil buffer: http://www.blitzbasic.com/Community/posts.php?topic=59699 use this instead of mine, because this one is better^^ |
| ||
the new version "shadowinclude", i have a problem for procedure tom for robust shadow pleace help me!!! :( i have optmized other than for fast silhouette the time render is very slow |
| ||
Please use forum tags for pasting code! :) Look for code/codebox http://www.blitzbasic.com/faq/faq_entry.php?id=2 |
| ||
ok thanks for link you help me!! |
| ||
progress?? |
| ||
yes in the old code posted i have insert multy light system :) this is a progress!! no speed up addizional :( stencil buffer in not very speed for 5 render execute if you have a idea for speed software or new alghoritm this is your house :D new update for code stencil: ;======================= ; Creazione immagine ombra ; Fast2 ? Function ShadowVolumeStenciBuffer_orig(ShowVol) EntityColor SHWSpriteFront, 5, 5, 5 EntityAlpha SHWSpriteFront, 0.3 ;===> ;SetBuffer TextureBuffer(ShwTex1) ;Cls SetBuffer BackBuffer() ;====================================================================== ;PASS 1 ;===> ;Render object modal standard ;===> HideEntity SHWSpriteFront ;colour buffer OFF SetRenderState(Direct3DDevice7, D3DRS_CULLMODE, D3DCULL_CCW) ;SetRenderState( Direct3DDevice7, D3DRS_ALPHABLENDENABLE, True ); ;SetRenderState( Direct3DDevice7, D3DRS_SRCBLEND, D3DBLEND_ONE ); ;SetRenderState( Direct3DDevice7, D3DRS_DESTBLEND, D3DBLEND_ONE ); ;lighting ON SetRenderState( Direct3DDevice7, D3DRS_AMBIENT, AMB_LIGHT ); |
| ||
this is a last update :( i not have orther idea link: http://digilander.libero.it/enzo_light/shw13.zip bye :( |
| ||
i will check it out when i get back from school... cya |
| ||
you is a student? i have 29 years what old are you? |
| ||
i am 14 years old, but a good coder... |
| ||
i have seen your work, but the bug with the faces isn't resolved yet :(... some of the edge faces are casting wrong... ![]() so they should be flipped... |
| ||
this bug is in the init object, if you change in the sphere 32 o over "The bug show" ;) the check vertex have a bug ?!?! what is a bug? what are I? what sale live? pleace help me for resolved bug! all for one!! one for all :D |
| ||
I'd like to thank you guys again, I think you pushed stencil shadows to its limits for Blitz3D on an open source base. Maybe the sooner or later somebody will add a fast volume creation. Thanks! |
| ||
Yeah, well done guys ... great work and alot of effort which is much appreciated. A damn shame it's not fast enough to use on a grander scale. Hopefully if BRL can respond to Tom's renderworld() feature request and we'll all have super fast shadows soon!! Stevie |
| ||
i have search the bug for create object the time for resolved and is ok!! |
| ||
sry, i do NOT understand your english... please come to icq, download icq and post your icq numbere here! ´cya |
| ||
ok the my number icq is 249548841 |
| ||
ok, thx :) |