-
Posts
1570 -
Joined
-
Last visited
-
Days Won
4
Content Type
Profiles
Forums
Events
Posts posted by DarkWanderer
-
-
That's because, and I'm not being grumpy here, DarkWanderer's explanation is not sufficient in a technical sense. Take the w value of the coefficient for example.
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.
-
1
-
-
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 ;)
-
1
- oPos is vertex position (everything that goes here doesn't interest us)
-
Т.е. достаточно ли одного источника помех в группе, чтобы помешать Фке, или РЭБ нужно включать всем?
Всем, TWS прекрасно проглатывает помехи.
И правильно я понимаю, что если 120ка пускается в режиме HOJ, то летит не по оптимальной траектории, тк не знает дальности, и не может верно вычислять упреждения?Верно. Но зато и радар ракета включает (непонятно почему) позже и оставляет минимум времени на маневр.
-
Баг: при нажатии Ctrl+I в режиме СНП частота повторения импульсов сбрасывается на АВТ, хотя с помощью Shift+I в режиме СНП можно выбрать только либо ППС, либо ЗПС.
-
Почему у аим 120 дистанция срабатывания взрывателя 15 метров а р-27 11?
Разьве дистанция эффективного подрыва зависит не от мощности заряда?
Смотри на вещи позитивно - AIM-120 иногда будет просто царапать обшивку, а вот если Р-27 попадет...
-
Миллион раз слышал этот довод, народ копипастит лихо. Только вот почему-то никто из копипастящих до сих пор не рискнул снять замок с двери своей квартиры. Все предпочитают с ключами ковыряться, а многие так еще и на охрану квартиры ставят
Если бы после того, как в квартиру забрались и украли заначку, эта заначка оставалась бы - может, и не ставили бы.
Аналогия некорректна.
-
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.
-
Ну вроде бы никаких серьезных претензий к Покрышкину никогда и не было. Ну, ходили слухи, что его специально "охраняли", на его имя "работали", и что он страшно не любил советскую технику; а с другой стороны ходят мнения, что ему наоборот кое-что недосчитали, но это не так важно на самом деле?
Важно то, что он выжил в 1941-42, сбивая при этом вражин, был одним из немногих, кто упорно отстаивал правильные принципы воздушного боя - и добился при этом цели, вел грамотное обучение молодняка, правильно вводил их в строй, грамотно командовал полком и дивизией. Он сумел выплыть из лап НКВД и репрессий по партийной линии. Многие из его учеников сами стали известными асами. В этой части вроде к нему претезий быть не может - это ж все было на самом деле?
Было. С реальными достижениями, изложенными нормальными формулировками я не спорю.
Я спорю с тем, о чем, пока я писал свое сообщение, высказался Чиж - с романтизацией и героизацией образов. Проще говоря - со стереотипами типа "а Покрышкин бы всех порвал".
Давай, начни с чистого листа! Может твоя научная работа еще приведет к тому, что Второй Мировой войны вообще не было?Приписать кому-то придуманные прегрешения и ополчиться на него за это. Очень объективный подход.
Даже не собираюсь спорить.
По существу пожалуйста.Господин maestro35, тему в сторону свернули вы. Вам и возвращать.
-
Некорректно ставить в один ряд киношных "героев" с реальным человеком, тем самым принижая его вклад в победу в ВОВ.
Есть мнение, что тот Покрышкин, о котором мы знаем, к реальности (и к настоящему пилоту) имеет столько же отношения, сколько Джеймс Бонд - к реальным британским разведчикам. В общем-то, это относится к многим персонажам - история своей страны редко пишется объективно
-
Это зависит от того, каким образом подключены к сети игроки, конкретно - тот из них, который собирается создавать сервер.
В отсутствие этой информации можно только посоветовать воспользоваться Hamachi.
-
-
А что, появился какой-то другой относительно недорогой способ изучать структуру чипов?
Термокриптоанализ...
-
По этой ссылке я и сделал. Не работает. Где конкретно ошибка?
Твой код:
RandomMissionEvents = trueMissionDate = { Year = 2010, Month = 4, Day = 5 }
local d = os.date("*t")
FragmentLanding =
{
TrashWaterOn = false,
TrashGroundOnLifeTime = 60, -- sek
PartsGroundOnLifeTime = 600, -- sek
}
Как должно быть:
RandomMissionEvents = true
--MissionDate = { Year = 2004, Month = 6, Day = 22 }
local d = os.date("*t")
MissionDate = { Year = d.year, Month = d.month, Day = d.day }
FragmentLanding =
{
TrashWaterOn = false,
TrashGroundOnLifeTime = 60, -- sek
PartsGroundOnLifeTime = 600, -- sek
}
Красным выделены отличия.
-
1
-
-
-
-
c0ff, а музыка в меню действительно твоего авторства?..
-
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? ;)
-
Нет, конечно - зачем мне разводить такой зоопарк с одной функцией? У меня реально назначена на снятие с паузы одна клавиша "S" для всех самолетов.
О чем я и говорю.
99.9% пользователей возможность назначать разные клавиши базовых функций для разных самолетов не понадобится. А тем ~10% из них, кому нужно будет сменить системные клавиши, придется вникать в необходимость ставить каждую клавишу в 7(?) экземплярах. Итого - сотня недоумевающих на каждого воспользовавшегося.
Не сочтите за критику, просто слишком уж спорное обоснование.
Кстати - какой из семи конфигов будет действовать, если зайти в игру наблюдателем?
P.S.Да, разговор наверное стоит вынести в отдельную тему.
-
Принтскрин - да. А вот паузу легко перекинуть - у меня на работе именно она переназначена на клавишу "S" - попробуй сам.
Т.е. у тебя стоит клавиша S - для Су-25, клавиша T - для Су-33, Home - для F-15 и т.д.? :)
-
Не более неправильный, чем несовместимые ни с чем клавиатуры с отсутствием некоторых клавиш. Это не упрек в чей-то адрес, а личное мнение.
Тем не менее, если у человека нет на клавиатуре Print screen - он вряд ли переназначит снятие скриншота на другую клавишу для одного самолета, оставляя ее на той же для другого. То же самое относится к паузе.
Конечно, это не баг, но "by слегка imperfect design".
-
-
a company started by and run by russians is a russian company regardless.
Yeah, Google is part of our plans for world domination. Now write your testament and clean the roof for a black helicopter.
The news is a good sign, though. Finally the cold war actually ends - if they succeed, of course.
-
You wouldn't believe the number of attacks on the web each day. Unfortunately many computers in Russia seem to be infected with botnet malware (perhaps fewer have access to protection software) - blocking these slightly lowers the chance of DDOS.
What's the connection between incoming traffic (botnets, DDOS, spam) and outgoing one (site browsing)?
Sky Color Modders?
in DCS Modding
Posted
Bucic, could you post your current sky and fog shaders? I'll check it out.