-
Posts
1570 -
Joined
-
Last visited
-
Days Won
4
About DarkWanderer
- Birthday 08/28/1988
Personal Information
-
Flight Simulators
Lock On FC
Orbiter
Falcon 4 AF -
Location
Moscow region
-
Interests
Theoretical aerodynamics, programming.
-
Occupation
Wide profile engineer
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Bucic, could you post your current sky and fog shaders? I'll check it out.
-
Sure, it's always someone else who is at fault... Here's a code with simple change: vs.1.1 dcl_position v0 ; ; Constants: ; ; c0-c3 - View*Projection ; c4-c6 - inverted View ; c7 - C0.x, C0.y, SpanX, SpanY ; c8 - (-2*h),1/R,Cz,(-4*(h^2-R^2) ; c9 - 0.0,0.5,1.0,h ; c10-c12- RGB conversion ; c13 - LumA,LumB,LumC,LumD ; c14 - LumE,Ax,Bx ; c15 - Cx,Dx,Ex,Ay ; c16 - By,Cy,Dy,Ey ; c17 - 1/zenith_rad,1/x_rad_zenith,1/y_rad_zenith,0.3 ; c18 - lightVector ; c19 - acos1,acos2,acos3,acos4 ; c20 - acos5,pi/2,log2(e),alt_adjust def c22, 0.85, 0.85, 1.00, 1.00 ; ;Set position in cam space: mad r0.x,v0.x,c7.z,c7.x mad r0.y,v0.y,c7.w,c7.y mov r0.z,c8.z ;transform position to world space dp3 r1.x,r0,c4 dp3 r1.y,r0,c5 dp3 r1.z,r0,c6 mov r1.w,c9.z ;normalize position: dp3 r0.w,r1,r1 rsq r2.w,r0.w mul r0,r1,r2.w ;;mov r0.w,c9.z ;1.0 ;calc distance to sphere mul r1.w,c8.x,r0.y ;-2h*p.y mad r1.x,r1.w,r1.w,c8.w ;^2-4*(h^2-R^2) mov r1.y,r1.x rsq r1.x,r1.x mul r1.y,r1.y,r1.x add r1.w,r1.w,r1.y mul r1.w,r1.w,c9.y ;get sphere point in world space mul r2,r0,r1.w mov r2.w,c9.z ;;transform and output dp4 oPos.x, r2, c0 dp4 oPos.y, r2, c1 dp4 oPos.z, r2, c2 dp4 oPos.w, r2, c3 ;---------------------------------------- ;normalize world pos dp3 r0.w,r2,r2 rsq r0.w,r0.w mul r4,r2,r0.w ;r4=normalized world pos max r4.y,r4.y,c9.x ; ;cos gamma dp3 r0.w,r4,c18 ;*************************************** ;acos gamma ;get |gamma| mul r1.w,r0.w,r0.w mov r2.w,r1.w rsq r2.w,r2.w mul r1.w,r1.w,r2.w ;r1.w=|gamma| ;calc z for |gamma|<0.5 mul r0.x,r0.w,r0.w ;r0.x=z for |gamma|<0.5 ;calc z for |gamma|>0.5 add r0.y,c9.z,-r1.w mul r0.y,r0.y,c9.y ;r0.y=z for |gamma|>0.5 ;calc x for |gamma|>0.5 mov r1.x,r0.y rsq r1.x,r1.x mul r0.z,r0.y,r1.x ;r0.z=x for |gamma|>0.5 ;set r1.x to 1 if |gamma|>=0.5 sge r1.x,r1.w,c9.y ;if (r1.x==1) r2.z=r0.y; else r2.z=r0.x //r2.z=r0.y*r1.x+(1-r1.x)*r0.x <=> r1.x*(r0.y-r0.x)+r0.x add r1.y,r0.y,-r0.x mad r2.z,r1.x,r1.y,r0.x ;if (r1.x==1) r2.x=r0.z;else r2.x=r1.w //r2.x=r0.z*r1.x+(1-r1.x)*r1.w <=> r1.x*(r0.z-r1.w)+r1.w add r1.y,r0.z,-r1.w mad r2.x,r1.x,r1.y,r1.w ;main_run(gamma)=(((( 4.2163199048E-2 * z+ 2.4181311049E-2) ; * z+ 4.5470025998E-2) ; * z+ 7.4953002686E-2) ; * z+ 1.6666752422E-1) ; * z ; * x+ x mad r3.z,r2.z,c19.x,c19.y mad r3.z,r3.z,r2.z,c19.z mad r3.z,r3.z,r2.z,c19.w mad r3.z,r3.z,r2.z,c20.x mul r3.z,r3.z,r2.z mad r3.z,r3.z,r2.x,r2.x ;;if (|gamma|>0.5) asin(|gamma|)=pi/2-2*r3.z; else asin(|gamma|)=r3.z add r3.w,r3.z,r3.z add r3.w,c20.y,-r3.w ;r3.w=pi/2-2*r3.z ;if (r1.x==1) r3.x=r3.w; else r3.x=r3.z //r3.x=r3.w*r1.x+(1-r1.x)*r3.z <=> r1.x*(r3.w-r3.z)+r3.z add r1.y,r3.w,-r3.z mad r3.x,r1.x,r1.y,r3.z ;if (gamma<0) r1.y=-1;else r1.y=+1 slt r1.y,r0.w,c9.x ;0 if >=0, 1 if <0 slt r1.z,-r0.w,c9.x ;1 if >0,0 if <=0 add r1.y,r1.z,-r1.y ;1-0, 0-1 mul r3.x,r3.x,r1.y add r3.x,c20.y,-r3.x ;r3.x=acos(gamma) in 30 commands ;************************************************** ; ;radiance = (1.0f+A*exp(B/Cos_theta)*(1.0f+C*exp(D*gamma)+E*cos_gamma*cos_gamma); ;e^y=2^(y*log2(e)) ;-------------------- ;r1.x=b/cos_theta mul r1.y,r4.y,c20.w ;verpos.y*alt_adjust rcp r1.x,r1.y mul r1.x,r1.x,c13.y ;b/(verpos.y*alt_adjust) ;e^r1.x=expp(r1.x*c20.z) mov r2.x,c9.z mul r7.w,r1.x,c20.z expp r7,r7.w mad r1.x,r7.z,c13.x,r2.x ;add r1.x,r1.x,c9.z ;r1.x=(lumA*exp(B/cos_theta)+1) ;;;D*0.3*gamma mul r1.y,r3.x,c17.w mul r1.y,r1.y,c13.w mul r7.w,r1.y,c20.z expp r7,r7.w mul r1.y,r7.z,c13.z ;r1.y=lumC*exp(D*0.3*gamma) ;;E*cos_gamma*cos_gamma mul r1.z,r0.w,r0.w mad r1.z,r1.z,c14.x,r2.x ;add r1.z,r1.z,c9.z ;r1.z=lumE*cos_gamma*cos_gamma+1 add r1.y,r1.y,r1.z mul r1.x,r1.x,r1.y mul r1.y,r1.x,c17.x ;r1.y=luminance ;----------------------------------------- ;r5.x=b/cos_theta rcp r5.x,r4.y mul r5.x,r5.x,c14.z ;Bx/verpos.y ;e^r5.x=expp(r5.x*c20.z) mul r7.w,r5.x,c20.z expp r7,r7.w mad r5.x,r7.z,c14.y,r2.x ;r5.x=(Ax*exp(Bx/cos_theta)+1) ;;;Dx*gamma mul r5.y,r3.x,c15.y mul r7.w,r5.y,c20.z expp r7,r7.w mul r5.y,r7.z,c15.x ;r5.y=Cx*exp(Dx*gamma) ;;Ex*cos_gamma*cos_gamma mul r5.z,r0.w,r0.w mad r5.z,r5.z,c15.z,r2.x ;r5.z=Ex*cos_gamma*cos_gamma+1 add r5.y,r5.y,r5.z mul r5.x,r5.x,r5.y mul r5.x,r5.x,c17.y ;r5.x=CIE_x ;---------------------------------------- ;----------------------------------------- ;r6.x=b/cos_theta rcp r6.x,r4.y mul r6.x,r6.x,c16.x ;By/verpos.y ;e^r5.x=expp(r5.x*c20.z) mul r7.w,r6.x,c20.z expp r7,r7.w mad r6.x,r7.z,c15.w,r2.x ;r6.x=(Ay*exp(Bx/cos_theta)+1) ;;;Dy*gamma mul r6.y,r3.x,c16.z mul r7.w,r6.y,c20.z expp r7,r7.w mul r6.y,r7.z,c16.y ;r6.y=Cy*exp(Dy*gamma) ;;Ey*cos_gamma*cos_gamma mul r6.z,r0.w,r0.w mad r6.z,r6.z,c16.w,r2.x ;r6.z=Ey*cos_gamma*cos_gamma+1 add r6.y,r6.y,r6.z mul r6.x,r6.x,r6.y mul r6.x,r6.x,c17.z ;r6.x=CIE_y ;----------------------------------------- rcp r1.w,r6.x mul r1.x,r1.w,r5.x mul r1.x,r1.x,r1.y add r1.z,c9.z,-r5.x add r1.z,r1.z,-r6.x mul r1.z,r1.z,r1.w mul r1.z,r1.z,r1.y dp3 r0.x,r1,c10 dp3 r0.y,r1,c11 dp3 r0.z,r1,c12 min r0,r0,c9.z mov r0.w,c9.x ;---------------------------------------- mul oD0, r0, c22 Here's the result: P.S. W component is alpha-channel and is not used in LO sky shaders.
-
The answer is in the text. You can take a screenshot (like you did), pick a probe of RGB values of the current color and compute the coefficients to multiply the output with. 1 in shader = 255, 0 in shader = 0.
-
Who summoned me?.. Since Bucic asked me to help... (...I can't refuse to lend a hand, however, don't expect wonders...) Actually, shader editing is pretty straigthforward, if you know the basics of vertex shaders and/or assembler. You can get a glimpse on them here. Basically, what we need is that: oPos is vertex position (everything that goes here doesn't interest us) oD0 - diffuse color (actual color of the sky) oD0.xyz = rgb of output color c** are constants, either set by the engine, either #defined in the assembler code itself The tricky part is the file structure. I didn't dig deep into it, but I can draw a coarse picture. The algorithm does the following: Positions the points of an abstact sphere around the camera (this part ends at 4 oPos.* lines) Calculates color coefficients based on some scientific formula (possibly, something of these series) in YUV(?) color space Converts the HSV into RGB via matrice defined in c10-c12 and writes them intro oD0. Knowing this, you can easily dig deeper and find out what this is all about ;), and for now, get some clues on actual editing. What can we do? First, we can define our own constants. Example: def c23, 0.4, 0.5, 0.6, 0.7 This gives us a constant with x = 0.4, y = 0.5, z = 0.6, w = 0.7 This is what some mods do - redefine the constants supplied by the game to modify the formulaes output. Note: if you don't want to redefine anything, all user-defined constants numbers should start from 23, as all preceding (excl., possibly, 21) are already taken. Second, we can modify the color output of the shader. Base code: mov oD0, r0 - directly moves values from registry 0 to output color. Example modification 1: mad r0.z,r0.z,c23.x,c23.z mov oD0, r0 - maps the x->y range of output blue color to 0.4*x+0.6->0.4*y+0.6 Example modification 2: mul r0, r0, r0 mov oD0, r0 - calculates the color value as a square of itself (pretty nasty looking, but shows the idea) Example modification 3: mul r0, r0, c23 mov oD0, r0 - directly multiplies the output values by provided constant values. Note that the line second from the end does the same with c22 - but it's effect is cancelled by the subsequent command. Please also note, that if you modify sky color, you should apply the same change to fog color - to avoid bad color misaligning of sky and far mountains. Given the information above and some patience - you have your chances ;)
-
Всем, TWS прекрасно проглатывает помехи. Верно. Но зато и радар ракета включает (непонятно почему) позже и оставляет минимум времени на маневр.
-
Баг: при нажатии Ctrl+I в режиме СНП частота повторения импульсов сбрасывается на АВТ, хотя с помощью Shift+I в режиме СНП можно выбрать только либо ППС, либо ЗПС.
-
SU-27 need corrections in FC2.0
DarkWanderer replied to TIGER's topic in Lock On: Flaming Cliffs 1 & 2
Actually, the fact that only the Su-27SM carries R-77, does not mean that Su-27S needs the full SM set of avionics - since MiG-29C, which is of the same "technology level", can carry it. Actually, the only things that need to be changed are WCS firmware and (possibly) pylon electronic interface. What I mean is that since LRM sacrifices realism for gameplay reasons, I don't see a reason for not putting R-77's in limited amounts on Su-27 on the servers that use it - for the very same gameplay reasons. -
Это зависит от того, каким образом подключены к сети игроки, конкретно - тот из них, который собирается создавать сервер. В отсутствие этой информации можно только посоветовать воспользоваться Hamachi.
-
Термокриптоанализ...
-
Твой код: Как должно быть: Красным выделены отличия.
-
Только что, на сервере Aviasibir: 1.Не работает дозаправка. (только что зашел на сервер. У самолета топлива ноль, стоит в ангаре. МиГ-29С) 2.Игра вылетела с ошибкой "pure virtual function call" при попытке пересесть в другой МиГ-29С
-
c0ff, а музыка в меню действительно твоего авторства?..
-
Who in the Lomac Community uses radar Automization?
DarkWanderer replied to 3Sqn_TomAce's topic in DCS Modding
Guys, throw an egg at me, but what I see here is some guy trying to support his position with arguments and a moderator(!) going personal on him. Am I the only one thinking something's wrong? ;) -
О чем я и говорю. 99.9% пользователей возможность назначать разные клавиши базовых функций для разных самолетов не понадобится. А тем ~10% из них, кому нужно будет сменить системные клавиши, придется вникать в необходимость ставить каждую клавишу в 7(?) экземплярах. Итого - сотня недоумевающих на каждого воспользовавшегося. Не сочтите за критику, просто слишком уж спорное обоснование. Кстати - какой из семи конфигов будет действовать, если зайти в игру наблюдателем? P.S.Да, разговор наверное стоит вынести в отдельную тему.
-
Т.е. у тебя стоит клавиша S - для Су-25, клавиша T - для Су-33, Home - для F-15 и т.д.? :)