Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
float4x4 WorldMatrix; float4x4 ViewMatrix; float4x4 ProjMatrix; float4 LightDir; float4 vs_main(float4 Position : POSITION, float3 Normal : NORMAL) : POSITION { float3 Norm = mul(Normal, (float3x3)WorldMatrix); float4 Pos = mul(Position, WorldMatrix); if (dot(-LightDir, Norm) < 0.f) { Pos += LightDir * 1000000.f; } Pos = mul(Pos, ViewMatrix); return mul(Pos, ProjMatrix); } TECHNIQUE T1 { PASS P0 { ZEnable = true; ZWriteEnable = false; ZFunc = Less; ColorWriteEnable = 0; Lighting = False; ShadeMode = Flat; FogEnable = False; StencilEnable = true; StencilFunc = Always; StencilZFail = Decr; StencilPass = Keep; CullMode = CCW; VertexShader = compile vs_1_1 vs_main(); } PASS P1 { CullMode = CW; StencilZFail = Incr; } } TECHNIQUE T2 { PASS P0 { AlphaBlendEnable = true; BlendOp = Add; SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; ZEnable = true; ZFunc = Always; StencilEnable = true; StencilFunc = NotEqual; StencilRef = 0; StencilZFail = Keep; StencilFail = Keep; StencilPass = Keep; CullMode = None; } } |
Zitat von »"Gotbread"«
dabei müsste aber die frontcap zur silluette verschoben werden was
ich mir nicht als rechenfreundlich vorstelle falls es geht
Zitat von »"Gotbread"«
Da tritt das Problem auf, da die beiden volumina sich überlagern,
was bei der kleinsten kammeraänderung zu den artefakten führt.
Zitat von »"David_pb"«
Wieso? Du hast deine Edgeliste einfach doppelt, der Rest passiert automatisch.
Quellcode |
|
1 2 3 4 |
___ ______________ /__ /| / | | | | => | | |__.|/ |______________/ |
Zitat von »"Gotbread"«
mit dem offsetten meinst du kleine werte addieren?
Werbeanzeige